[llvm-commits] CVS: llvm/lib/VMCore/Mangler.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Sep 7 11:20:59 PDT 2006



Changes in directory llvm/lib/VMCore:

Mangler.cpp updated: 1.28 -> 1.29
---
Log message:

Add new option to leave asm names alone


---
Diffs of the changes:  (+6 -1)

 Mangler.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/Mangler.cpp
diff -u llvm/lib/VMCore/Mangler.cpp:1.28 llvm/lib/VMCore/Mangler.cpp:1.29
--- llvm/lib/VMCore/Mangler.cpp:1.28	Wed Jun  7 18:03:13 2006
+++ llvm/lib/VMCore/Mangler.cpp	Thu Sep  7 13:20:41 2006
@@ -33,6 +33,10 @@
   std::string Result;
   if (X.empty()) return X;  // Empty names are uniqued by the caller.
   
+  // If PreserveAsmNames is set, names with asm identifiers are not modified. 
+  if (PreserveAsmNames && X[0] == 1)
+    return X;
+  
   if (!UseQuotes) {
     // If X does not start with (char)1, add the prefix.
     std::string::const_iterator I = X.begin();
@@ -174,7 +178,8 @@
 
 
 Mangler::Mangler(Module &M, const char *prefix)
-  : Prefix(prefix), UseQuotes(false), Count(0), TypeCounter(0) {
+  : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false),
+    Count(0), TypeCounter(0) {
   std::fill(AcceptableChars, 
           AcceptableChars+sizeof(AcceptableChars)/sizeof(AcceptableChars[0]),
             0);






More information about the llvm-commits mailing list