lld: Use lookup instead of find. NFC, just simpler.
Obtained from: LLVM r323395 by Rafael Espindola
This commit is contained in:
parent
2164def67c
commit
032c24abe6
@ -617,9 +617,8 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSection *Sec) {
|
|||||||
// If a memory region name was specified in the output section command,
|
// If a memory region name was specified in the output section command,
|
||||||
// then try to find that region first.
|
// then try to find that region first.
|
||||||
if (!Sec->MemoryRegionName.empty()) {
|
if (!Sec->MemoryRegionName.empty()) {
|
||||||
auto It = MemoryRegions.find(Sec->MemoryRegionName);
|
if (MemoryRegion *M = MemoryRegions.lookup(Sec->MemoryRegionName))
|
||||||
if (It != MemoryRegions.end())
|
return M;
|
||||||
return It->second;
|
|
||||||
error("memory region '" + Sec->MemoryRegionName + "' not declared");
|
error("memory region '" + Sec->MemoryRegionName + "' not declared");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user