[ELF] Replace HasContents with HasSections. NFC
authorEugene Leviant <evgeny.leviant@gmail.com>
Wed, 14 Sep 2016 08:32:36 +0000 (08:32 +0000)
committerEugene Leviant <evgeny.leviant@gmail.com>
Wed, 14 Sep 2016 08:32:36 +0000 (08:32 +0000)
llvm-svn: 281449

lld/ELF/LinkerScript.cpp
lld/ELF/LinkerScript.h
lld/ELF/Writer.cpp

index 9442eed..054f1e4 100644 (file)
@@ -762,7 +762,7 @@ void ScriptParser::readLinkerScript() {
     } else if (Tok == "VERSION") {
       readVersion();
     } else if (SymbolAssignment *Cmd = readProvideOrAssignment(Tok, true)) {
-      if (Opt.HasContents)
+      if (Opt.HasSections)
         Opt.Commands.emplace_back(Cmd);
       else
         Opt.Assignments.emplace_back(Cmd);
@@ -923,7 +923,7 @@ void ScriptParser::readSearchDir() {
 }
 
 void ScriptParser::readSections() {
-  Opt.HasContents = true;
+  Opt.HasSections = true;
   expect("{");
   while (!Error && !skip("}")) {
     StringRef Tok = next();
index 9232715..f428d85 100644 (file)
@@ -146,7 +146,7 @@ struct ScriptConfiguration {
   // Used to assign sections to headers.
   std::vector<PhdrsCommand> PhdrsCommands;
 
-  bool HasContents = false;
+  bool HasSections = false;
 
   llvm::BumpPtrAllocator Alloc;
 
index 820674f..a73286a 100644 (file)
@@ -252,7 +252,7 @@ template <class ELFT> void Writer<ELFT>::run() {
   Script<ELFT>::X->createAssignments();
 
   Script<ELFT>::X->OutputSections = &OutputSections;
-  if (ScriptConfig->HasContents)
+  if (ScriptConfig->HasSections)
     Script<ELFT>::X->createSections(Factory);
   else
     createSections();
@@ -267,7 +267,7 @@ template <class ELFT> void Writer<ELFT>::run() {
     Phdrs = Script<ELFT>::X->hasPhdrsCommands() ? Script<ELFT>::X->createPhdrs()
                                                 : createPhdrs();
     fixHeaders();
-    if (ScriptConfig->HasContents) {
+    if (ScriptConfig->HasSections) {
       Script<ELFT>::X->assignAddresses();
     } else {
       fixSectionAlignments();
@@ -610,7 +610,7 @@ template <class ELFT> void Writer<ELFT>::addReservedSymbols() {
     Symtab<ELFT>::X->addIgnored("__tls_get_addr");
 
   // If linker script do layout we do not need to create any standart symbols.
-  if (ScriptConfig->HasContents)
+  if (ScriptConfig->HasSections)
     return;
 
   ElfSym<ELFT>::EhdrStart = Symtab<ELFT>::X->addIgnored("__ehdr_start");
@@ -1060,7 +1060,7 @@ template <class ELFT> void Writer<ELFT>::fixSectionAlignments() {
 // sections. These are special, we do not include them into output sections
 // list, but have them to simplify the code.
 template <class ELFT> void Writer<ELFT>::fixHeaders() {
-  uintX_t BaseVA = ScriptConfig->HasContents ? 0 : Config->ImageBase;
+  uintX_t BaseVA = ScriptConfig->HasSections ? 0 : Config->ImageBase;
   Out<ELFT>::ElfHeader->setVA(BaseVA);
   uintX_t Off = Out<ELFT>::ElfHeader->getSize();
   Out<ELFT>::ProgramHeaders->setVA(Off + BaseVA);