[llvm-commits] [llvm] r42071 - in /llvm/trunk: include/llvm/Support/Mangler.h lib/VMCore/Mangler.cpp

Bill Wendling isanbard at gmail.com
Mon Sep 17 15:39:32 PDT 2007


Author: void
Date: Mon Sep 17 17:39:32 2007
New Revision: 42071

URL: http://llvm.org/viewvc/llvm-project?rev=42071&view=rev
Log:
Add support for appending a suffix to the end of a mangled name.

Modified:
    llvm/trunk/include/llvm/Support/Mangler.h
    llvm/trunk/lib/VMCore/Mangler.cpp

Modified: llvm/trunk/include/llvm/Support/Mangler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Mangler.h?rev=42071&r1=42070&r2=42071&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/Mangler.h (original)
+++ llvm/trunk/include/llvm/Support/Mangler.h Mon Sep 17 17:39:32 2007
@@ -94,7 +94,7 @@
   /// getValueName - Returns the mangled name of V, an LLVM Value,
   /// in the current module.
   ///
-  std::string getValueName(const GlobalValue *V);
+  std::string getValueName(const GlobalValue *V, const char *Suffix = "");
   std::string getValueName(const Value *V);
 
   /// makeNameProper - We don't want identifier names with ., space, or

Modified: llvm/trunk/lib/VMCore/Mangler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Mangler.cpp?rev=42071&r1=42070&r2=42071&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Mangler.cpp (original)
+++ llvm/trunk/lib/VMCore/Mangler.cpp Mon Sep 17 17:39:32 2007
@@ -126,7 +126,7 @@
 }
 
 
-std::string Mangler::getValueName(const GlobalValue *GV) {
+std::string Mangler::getValueName(const GlobalValue *GV, const char * Suffix) {
   // Check to see whether we've already named V.
   std::string &Name = Memo[GV];
   if (!Name.empty())
@@ -143,7 +143,7 @@
     static unsigned GlobalID = 0;
     Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++);
   } else if (!MangledGlobals.count(GV)) {
-    Name = makeNameProper(GV->getName(), Prefix);
+    Name = makeNameProper(GV->getName() + Suffix, Prefix);
   } else {
     unsigned TypeUniqueID = getTypeID(GV->getType());
     Name = "l" + utostr(TypeUniqueID) + "_" + makeNameProper(GV->getName());





More information about the llvm-commits mailing list