[llvm] r288302 - LTO: Remove Symbol::getIRName().

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 18:51:13 PST 2016


Author: pcc
Date: Wed Nov 30 20:51:12 2016
New Revision: 288302

URL: http://llvm.org/viewvc/llvm-project?rev=288302&view=rev
Log:
LTO: Remove Symbol::getIRName().

Its only use was in the LTO implementation. Also document
Symbol::getName().

Modified:
    llvm/trunk/include/llvm/LTO/LTO.h
    llvm/trunk/lib/LTO/LTO.cpp

Modified: llvm/trunk/include/llvm/LTO/LTO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTO.h?rev=288302&r1=288301&r2=288302&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTO.h (original)
+++ llvm/trunk/include/llvm/LTO/LTO.h Wed Nov 30 20:51:12 2016
@@ -162,12 +162,9 @@ public:
       skip();
     }
 
+    /// Returns the mangled name of the global.
     StringRef getName() const { return Name; }
-    StringRef getIRName() const {
-      if (GV)
-        return GV->getName();
-      return StringRef();
-    }
+
     uint32_t getFlags() const { return Flags; }
     GlobalValue::VisibilityTypes getVisibility() const {
       if (GV)

Modified: llvm/trunk/lib/LTO/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=288302&r1=288301&r2=288302&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTO.cpp (original)
+++ llvm/trunk/lib/LTO/LTO.cpp Wed Nov 30 20:51:12 2016
@@ -381,7 +381,10 @@ Error LTO::addRegularLTO(std::unique_ptr
     // We also record if we see an instance of a common as prevailing, so that
     // if none is prevailing we can ignore it later.
     if (Sym.getFlags() & object::BasicSymbolRef::SF_Common) {
-      auto &CommonRes = RegularLTO.Commons[Sym.getIRName()];
+      // FIXME: We should figure out what to do about commons defined by asm.
+      // For now they aren't reported correctly by ModuleSymbolTable.
+      assert(GV);
+      auto &CommonRes = RegularLTO.Commons[GV->getName()];
       CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize());
       CommonRes.Align = std::max(CommonRes.Align, Sym.getCommonAlignment());
       CommonRes.Prevailing |= Res.Prevailing;




More information about the llvm-commits mailing list