make sure to send external symbols through the mangler,
authorChris Lattner <sabre@nondot.org>
Wed, 9 Sep 2009 00:23:32 +0000 (00:23 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 9 Sep 2009 00:23:32 +0000 (00:23 +0000)
this fixes mingw-alloca.ll with the new asmprinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81301 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmPrinter/X86MCInstLower.cpp

index 3c8f4031743278629960ff4a5493962eb8c8bb1b..ccc12d9e0b9d54817c0a7624aaea211ff603c70e 100644 (file)
@@ -112,11 +112,9 @@ MCSymbol *X86ATTAsmPrinter::GetGlobalAddressSymbol(const MachineOperand &MO) {
 }
 
 MCSymbol *X86ATTAsmPrinter::GetExternalSymbolSymbol(const MachineOperand &MO) {
-  std::string Name = MO.getSymbolName();
-  if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
+  std::string Name = Mang->makeNameProper(MO.getSymbolName());
+  if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB)
     Name += "$stub";
-  }
-  
   
   switch (MO.getTargetFlags()) {
   default: llvm_unreachable("Unknown target flag on GV operand");
@@ -129,7 +127,7 @@ MCSymbol *X86ATTAsmPrinter::GetExternalSymbolSymbol(const MachineOperand &MO) {
     Name = "__imp_" + Name;
     break;
   case X86II::MO_DARWIN_STUB:
-    FnStubs[Name] = MO.getSymbolName();
+    FnStubs[Name] = Mang->makeNameProper(MO.getSymbolName());
     break;
     // FIXME: These probably should be a modifier on the symbol or something??
   case X86II::MO_TLSGD:     Name += "@TLSGD";     break;