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 | |
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
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 20 | ||||
-rw-r--r-- | lld/ELF/LinkerScript.h | 8 |
2 files changed, 14 insertions, 14 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("}")) { diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 309599b7df9..e1c6b510b7d 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -44,10 +44,10 @@ private: // This enum represents what we can observe in SECTIONS tag of script: // Expr is a location counter change, like ". = . + 0x1000" // Section is a description of output section, like ".data :..." -enum class Command { Expr, Section }; +enum SectionsCommandKind { ExprKind, SectionKind }; -struct LocationNode { - Command Type; +struct SectionsCommand { + SectionsCommandKind Kind; std::vector<StringRef> Expr; StringRef SectionName; }; @@ -85,7 +85,7 @@ private: llvm::StringMap<std::vector<uint8_t>> Filler; // Used to assign addresses to sections. - std::vector<LocationNode> Locations; + std::vector<SectionsCommand> Commands; llvm::BumpPtrAllocator Alloc; }; |