diff options
author | Rui Ueyama <ruiu@google.com> | 2016-04-18 21:00:45 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-04-18 21:00:45 +0000 |
commit | 9e957a0ac6d1314bef34e0a6b111f82b4b4e504a (patch) | |
tree | d303765e384c55f7cc4a26e3fd6093daa80c5fb1 /lld/ELF/LinkerScript.cpp | |
parent | 54115af45e0e9cb2f0ff3ea674560a9668c94178 (diff) | |
download | bcm5719-llvm-9e957a0ac6d1314bef34e0a6b111f82b4b4e504a.tar.gz bcm5719-llvm-9e957a0ac6d1314bef34e0a6b111f82b4b4e504a.zip |
Rename LocationNode -> SectionsCommand.
They are called sections-command in the doc, so it is nice to keep
it consistent with it.
https://sourceware.org/binutils/docs/ld/SECTIONS.html#SECTIONS
llvm-svn: 266668
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 5479123da16..f07dfcde8d9 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -113,7 +113,7 @@ void LinkerScript::assignAddresses( StringRef Name = Sec->getName(); auto I = std::find(SectionOrder.begin(), SectionOrder.end(), Name); if (I == SectionOrder.end()) - Locations.push_back({Command::Section, {}, Name}); + Commands.push_back({SectionKind, {}, Name}); } // Assign addresses as instructed by linker script SECTIONS sub-commands. @@ -121,13 +121,13 @@ void LinkerScript::assignAddresses( uintX_t VA = Out<ELFT>::ElfHeader->getSize() + Out<ELFT>::ProgramHeaders->getSize(); - for (LocationNode &Node : Locations) { - if (Node.Type == Command::Expr) { - VA = evaluate(Node.Expr, VA); + for (SectionsCommand &Cmd : Commands) { + if (Cmd.Kind == ExprKind) { + VA = evaluate(Cmd.Expr, VA); continue; } - OutputSectionBase<ELFT> *Sec = findSection(Sections, Node.SectionName); + OutputSectionBase<ELFT> *Sec = findSection(Sections, Cmd.SectionName); if (!Sec) continue; @@ -400,22 +400,22 @@ void ScriptParser::readSectionPatterns(StringRef OutSec, bool Keep) { void ScriptParser::readLocationCounterValue() { expect("."); expect("="); - Script->Locations.push_back({Command::Expr, {}, ""}); - LocationNode &Node = Script->Locations.back(); + Script->Commands.push_back({ExprKind, {}, ""}); + SectionsCommand &Cmd = Script->Commands.back(); while (!Error) { StringRef Tok = next(); if (Tok == ";") break; - Node.Expr.push_back(Tok); + Cmd.Expr.push_back(Tok); } - if (Node.Expr.empty()) + if (Cmd.Expr.empty()) error("error in location counter expression"); } void ScriptParser::readOutputSectionDescription() { StringRef OutSec = next(); Script->SectionOrder.push_back(OutSec); - Script->Locations.push_back({Command::Section, {}, OutSec}); + Script->Commands.push_back({SectionKind, {}, OutSec}); expect(":"); expect("{"); while (!Error && !skip("}")) { |