remove a couple of actively incorrect uses of getMangledName.
authorChris Lattner <sabre@nondot.org>
Sat, 16 Jan 2010 02:16:09 +0000 (02:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 16 Jan 2010 02:16:09 +0000 (02:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93627 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ELFWriter.cpp
lib/Target/TargetLoweringObjectFile.cpp

index 5e5f58970ea3a65c9749e58ad810abf878c05147..b9d24dca3af229e66c1f1f5e0a5acca951959f07 100644 (file)
@@ -54,7 +54,7 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/Support/raw_ostream.h"
-
+#include "llvm/ADT/SmallString.h"
 using namespace llvm;
 
 char ELFWriter::ID = 0;
@@ -906,9 +906,11 @@ void ELFWriter::EmitStringTable(const std::string &ModuleName) {
     ELFSym &Sym = *(*I);
 
     std::string Name;
-    if (Sym.isGlobalValue())
-      Name.append(Mang->getMangledName(Sym.getGlobalValue()));
-    else if (Sym.isExternalSym())
+    if (Sym.isGlobalValue()) {
+      SmallString<40> NameStr;
+      Mang->getNameWithPrefix(NameStr, Sym.getGlobalValue(), false);
+      Name.append(NameStr.begin(), NameStr.end());
+    } else if (Sym.isExternalSym())
       Name.append(Sym.getExternalSymbol());
     else if (Sym.isFileType())
       Name.append(ModuleName);
index 70e8008eb44a12b6318bad5ce9b8eec6a6a1a564..6ecbec406473b7b6213336de7d94aeeb23628e95 100644 (file)
@@ -955,7 +955,8 @@ shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler *Mang) const {
     // FIXME: ObjC metadata is currently emitted as internal symbols that have
     // \1L and \0l prefixes on them.  Fix them to be Private/LinkerPrivate and
     // this horrible hack can go away.
-    const std::string &Name = Mang->getMangledName(GV);
+    SmallString<64> Name;
+    Mang->getNameWithPrefix(NameTmp, GV, false);
     if (Name[0] == 'L' || Name[0] == 'l')
       return false;
   }