[lld] r293143 - Rename NotFlags -> NegFlags.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 18:58:59 PST 2017


Author: ruiu
Date: Wed Jan 25 20:58:59 2017
New Revision: 293143

URL: http://llvm.org/viewvc/llvm-project?rev=293143&view=rev
Log:
Rename NotFlags -> NegFlags.

Negative flags are still bit flags, so I think "not flag" is a very good name.

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/LinkerScript.h

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=293143&r1=293142&r2=293143&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Wed Jan 25 20:58:59 2017
@@ -547,7 +547,7 @@ MemoryRegion *LinkerScript<ELFT>::findMe
   // 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.NotFlags & Sec->Flags) == 0)
+    if ((MR.Flags & Sec->Flags) != 0 && (MR.NegFlags & Sec->Flags) == 0)
       return &MR;
   }
 
@@ -2027,9 +2027,9 @@ void ScriptParser::readMemory() {
     StringRef Name = next();
 
     uint32_t Flags = 0;
-    uint32_t NotFlags = 0;
+    uint32_t NegFlags = 0;
     if (consume("(")) {
-      std::tie(Flags, NotFlags) = readMemoryAttributes();
+      std::tie(Flags, NegFlags) = readMemoryAttributes();
       expect(")");
     }
     expect(":");
@@ -2043,7 +2043,7 @@ void ScriptParser::readMemory() {
     if (It != Opt.MemoryRegions.end())
       setError("region '" + Name + "' already defined");
     else
-      Opt.MemoryRegions[Name] = {Name, Origin, Length, Origin, Flags, NotFlags};
+      Opt.MemoryRegions[Name] = {Name, Origin, Length, Origin, Flags, NegFlags};
   }
 }
 
@@ -2052,7 +2052,7 @@ void ScriptParser::readMemory() {
 // are only used when an explicit memory region name is not used.
 std::pair<uint32_t, uint32_t> ScriptParser::readMemoryAttributes() {
   uint32_t Flags = 0;
-  uint32_t NotFlags = 0;
+  uint32_t NegFlags = 0;
   bool Invert = false;
 
   for (char C : next().lower()) {
@@ -2069,11 +2069,11 @@ std::pair<uint32_t, uint32_t> ScriptPars
       setError("invalid memory region attribute");
 
     if (Invert)
-      NotFlags |= Flag;
+      NegFlags |= Flag;
     else
       Flags |= Flag;
   }
-  return {Flags, NotFlags};
+  return {Flags, NegFlags};
 }
 
 void elf::readLinkerScript(MemoryBufferRef MB) {

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=293143&r1=293142&r2=293143&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Wed Jan 25 20:58:59 2017
@@ -198,7 +198,7 @@ struct MemoryRegion {
   uint64_t Length;
   uint64_t Offset;
   uint32_t Flags;
-  uint32_t NotFlags;
+  uint32_t NegFlags;
 };
 
 class LinkerScriptBase {




More information about the llvm-commits mailing list