diff options
| author | Rui Ueyama <ruiu@google.com> | 2017-04-05 03:18:46 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2017-04-05 03:18:46 +0000 |
| commit | 2e081a4ff0178cf9e15a68e2d6a9446c1317f962 (patch) | |
| tree | 39c9486664e5f0f81a9992fb08b0629d3fa92be7 /lld/ELF/LinkerScript.cpp | |
| parent | 72e107f30241b47c9b440ba5362c1cdc9b4a08e4 (diff) | |
| download | bcm5719-llvm-2e081a4ff0178cf9e15a68e2d6a9446c1317f962.tar.gz bcm5719-llvm-2e081a4ff0178cf9e15a68e2d6a9446c1317f962.zip | |
Make variable names consistent. NFC.
llvm-svn: 299499
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index d6199a94e9f..3590153dcb8 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -554,42 +554,43 @@ void LinkerScript::switchTo(OutputSection *Sec) { } void LinkerScript::process(BaseCommand &Base) { - // This handles the assignments to symbol or to a location counter (.) - if (auto *AssignCmd = dyn_cast<SymbolAssignment>(&Base)) { - assignSymbol(AssignCmd, true); + // This handles the assignments to symbol or to the dot. + if (auto *Cmd = dyn_cast<SymbolAssignment>(&Base)) { + assignSymbol(Cmd, true); return; } // Handle BYTE(), SHORT(), LONG(), or QUAD(). - if (auto *DataCmd = dyn_cast<BytesDataCommand>(&Base)) { - DataCmd->Offset = Dot - CurOutSec->Addr; - Dot += DataCmd->Size; + if (auto *Cmd = dyn_cast<BytesDataCommand>(&Base)) { + Cmd->Offset = Dot - CurOutSec->Addr; + Dot += Cmd->Size; CurOutSec->Size = Dot - CurOutSec->Addr; return; } - if (auto *AssertCmd = dyn_cast<AssertCommand>(&Base)) { - AssertCmd->Expression(); + // Handle ASSERT(). + if (auto *Cmd = dyn_cast<AssertCommand>(&Base)) { + Cmd->Expression(); return; } - // It handles single input section description command, - // calculates and assigns the offsets for each section and also + // Handle a single input section description command. + // It calculates and assigns the offsets for each section and also // updates the output section size. - auto &ICmd = cast<InputSectionDescription>(Base); - for (InputSectionBase *IB : ICmd.Sections) { + auto &Cmd = cast<InputSectionDescription>(Base); + for (InputSectionBase *Sec : Cmd.Sections) { // We tentatively added all synthetic sections at the beginning and removed // empty ones afterwards (because there is no way to know whether they were // going be empty or not other than actually running linker scripts.) // We need to ignore remains of empty sections. - if (auto *Sec = dyn_cast<SyntheticSection>(IB)) - if (Sec->empty()) + if (auto *S = dyn_cast<SyntheticSection>(Sec)) + if (S->empty()) continue; - if (!IB->Live) + if (!Sec->Live) continue; - assert(CurOutSec == IB->OutSec || AlreadyOutputOS.count(IB->OutSec)); - output(cast<InputSection>(IB)); + assert(CurOutSec == Sec->OutSec || AlreadyOutputOS.count(Sec->OutSec)); + output(cast<InputSection>(Sec)); } } @@ -628,10 +629,10 @@ MemoryRegion *LinkerScript::findMemoryRegion(OutputSectionCommand *Cmd, return nullptr; // See if a region can be found by matching section flags. - for (auto &MRI : Opt.MemoryRegions) { - MemoryRegion &MR = MRI.second; - if ((MR.Flags & Sec->Flags) != 0 && (MR.NegFlags & Sec->Flags) == 0) - return &MR; + for (auto &Pair : Opt.MemoryRegions) { + MemoryRegion &M = Pair.second; + if ((M.Flags & Sec->Flags) && (M.NegFlags & Sec->Flags) == 0) + return &M; } // Otherwise, no suitable region was found. |

