[llvm-branch-commits] [llvm-branch] r86190 - /llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Dan Gohman gohman at apple.com
Thu Nov 5 15:15:47 PST 2009


Author: djg
Date: Thu Nov  5 17:15:47 2009
New Revision: 86190

URL: http://llvm.org/viewvc/llvm-project?rev=86190&view=rev
Log:
$ svn merge -c 86189 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r86189 into '.':
U    lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=86190&r1=86189&r2=86190&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Nov  5 17:15:47 2009
@@ -1636,13 +1636,17 @@
   assert(BB->hasName() &&
          "Address of anonymous basic block not supported yet!");
 
-  // FIXME: This isn't guaranteed to produce a unique name even if the
-  // block and function have a name.
-  std::string Mangled =
-    Mang->getMangledName(F, Mang->makeNameProper(BB->getName()).c_str(),
-                         /*ForcePrivate=*/true);
+  // This code must use the function name itself, and not the function number,
+  // since it must be possible to generate the label name from within other
+  // functions.
+  std::string FuncName = Mang->getMangledName(F);
 
-  return OutContext.GetOrCreateSymbol(StringRef(Mangled));
+  SmallString<60> Name;
+  raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() << "BA"
+    << FuncName.size() << '_' << FuncName << '_'
+    << Mang->makeNameProper(BB->getName());
+
+  return OutContext.GetOrCreateSymbol(Name.str());
 }
 
 MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {





More information about the llvm-branch-commits mailing list