[llvm-commits] [llvm] r75743 - in /llvm/trunk: include/llvm/Support/Mangler.h lib/VMCore/Mangler.cpp tools/bugpoint/Miscompilation.cpp

Chris Lattner sabre at nondot.org
Tue Jul 14 21:50:47 PDT 2009


Author: lattner
Date: Tue Jul 14 23:50:47 2009
New Revision: 75743

URL: http://llvm.org/viewvc/llvm-project?rev=75743&view=rev
Log:
eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself.

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

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

==============================================================================
--- llvm/trunk/include/llvm/Support/Mangler.h (original)
+++ llvm/trunk/include/llvm/Support/Mangler.h Tue Jul 14 23:50:47 2009
@@ -38,10 +38,6 @@
   /// the space character.  By default, this is false.
   bool UseQuotes;
 
-  /// PreserveAsmNames - If this is set, the asm escape character is not removed
-  /// from names with 'asm' specifiers.
-  bool PreserveAsmNames;
-
   /// AnonGlobalIDs - We need to give global values the same name every time
   /// they are mangled.  This keeps track of the number we give to anonymous
   /// ones.
@@ -65,10 +61,6 @@
   /// strings for assembler labels.
   void setUseQuotes(bool Val) { UseQuotes = Val; }
 
-  /// setPreserveAsmNames - If the mangler should not strip off the asm name
-  /// @verbatim identifier (\001), this should be set. @endverbatim
-  void setPreserveAsmNames(bool Val) { PreserveAsmNames = Val; }
-
   /// Acceptable Characters - This allows the target to specify which characters
   /// are acceptable to the assembler without being mangled.  By default we
   /// allow letters, numbers, '_', '$', and '.', which is what GAS accepts.

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

==============================================================================
--- llvm/trunk/lib/VMCore/Mangler.cpp (original)
+++ llvm/trunk/lib/VMCore/Mangler.cpp Tue Jul 14 23:50:47 2009
@@ -35,10 +35,6 @@
                                     bool hasPrivateLinkage) {
   assert(!X.empty() && "Cannot mangle empty strings");
   
-  // If PreserveAsmNames is set, names with asm identifiers are not modified. 
-  if (PreserveAsmNames && X[0] == 1)
-    return X;
-
   if (!UseQuotes) {
     std::string Result;
 
@@ -149,7 +145,7 @@
 
 Mangler::Mangler(Module &M, const char *prefix, const char *privatePrefix)
   : Prefix(prefix), PrivatePrefix (privatePrefix), UseQuotes(false),
-    PreserveAsmNames(false), NextAnonGlobalID(1) {
+    NextAnonGlobalID(1) {
   std::fill(AcceptableChars, array_endof(AcceptableChars), 0);
 
   // Letters and numbers are acceptable.

Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=75743&r1=75742&r2=75743&view=diff

==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Tue Jul 14 23:50:47 2009
@@ -241,12 +241,17 @@
   Mangler Mang(*M);
   // Agree with the CBE on symbol naming
   Mang.markCharUnacceptable('.');
-  Mang.setPreserveAsmNames(true);
   for (Module::global_iterator I = M->global_begin(), E = M->global_end();
-       I != E; ++I)
-    I->setName(Mang.getMangledName(I));
-  for (Module::iterator  I = M->begin(),  E = M->end();  I != E; ++I)
-    I->setName(Mang.getMangledName(I));
+       I != E; ++I) {
+    // Don't mangle asm names.
+    if (!I->hasName() || I->getName()[0] != 1)
+      I->setName(Mang.getMangledName(I));
+  }
+  for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
+    // Don't mangle asm names.
+    if (!I->hasName() || I->getName()[0] != 1)
+      I->setName(Mang.getMangledName(I));
+  }
 }
 
 /// ExtractLoops - Given a reduced list of functions that still exposed the bug,





More information about the llvm-commits mailing list