[llvm] r195806 - Remove dead argument.

Rafael Espindola rafael.espindola at gmail.com
Tue Nov 26 18:25:20 PST 2013


Author: rafael
Date: Tue Nov 26 20:25:20 2013
New Revision: 195806

URL: http://llvm.org/viewvc/llvm-project?rev=195806&view=rev
Log:
Remove dead argument.

Modified:
    llvm/trunk/include/llvm/Target/Mangler.h
    llvm/trunk/lib/Target/Mangler.cpp

Modified: llvm/trunk/include/llvm/Target/Mangler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Mangler.h?rev=195806&r1=195805&r2=195806&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/Mangler.h (original)
+++ llvm/trunk/include/llvm/Target/Mangler.h Tue Nov 26 20:25:20 2013
@@ -52,14 +52,13 @@ public:
   /// and the specified global variable's name.  If the global variable doesn't
   /// have a name, this fills in a unique name for the global.
   void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV,
-                         bool isImplicitlyPrivate, bool UseGlobalPrefix = true);
+                         bool isImplicitlyPrivate);
 
   /// getNameWithPrefix - Fill OutName with the name of the appropriate prefix
   /// and the specified name as the global variable name.  GVName must not be
   /// empty.
   void getNameWithPrefix(SmallVectorImpl<char> &OutName, const Twine &GVName,
-                         ManglerPrefixTy PrefixTy = Mangler::Default,
-                         bool UseGlobalPrefix = true);
+                         ManglerPrefixTy PrefixTy = Mangler::Default);
 };
 
 } // End llvm namespace

Modified: llvm/trunk/lib/Target/Mangler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mangler.cpp?rev=195806&r1=195805&r2=195806&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mangler.cpp (original)
+++ llvm/trunk/lib/Target/Mangler.cpp Tue Nov 26 20:25:20 2013
@@ -27,8 +27,7 @@ using namespace llvm;
 /// and the specified name as the global variable name.  GVName must not be
 /// empty.
 void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
-                                const Twine &GVName, ManglerPrefixTy PrefixTy,
-                                bool UseGlobalPrefix) {
+                                const Twine &GVName, ManglerPrefixTy PrefixTy) {
   SmallString<256> TmpData;
   StringRef Name = GVName.toStringRef(TmpData);
   assert(!Name.empty() && "getNameWithPrefix requires non-empty name");
@@ -47,16 +46,15 @@ void Mangler::getNameWithPrefix(SmallVec
       OutName.append(Prefix, Prefix+strlen(Prefix));
     }
 
-    if (UseGlobalPrefix) {
-      const char *Prefix = MAI->getGlobalPrefix();
-      if (Prefix[0] == 0)
-        ; // Common noop, no prefix.
-      else if (Prefix[1] == 0)
-        OutName.push_back(Prefix[0]);  // Common, one character prefix.
-      else
-        // Arbitrary length prefix.
-        OutName.append(Prefix, Prefix+strlen(Prefix));
-    }
+
+    const char *Prefix = MAI->getGlobalPrefix();
+    if (Prefix[0] == 0)
+      ; // Common noop, no prefix.
+    else if (Prefix[1] == 0)
+      OutName.push_back(Prefix[0]);  // Common, one character prefix.
+    else
+      // Arbitrary length prefix.
+      OutName.append(Prefix, Prefix+strlen(Prefix));
   }
 
   // If this is a simple string that doesn't need escaping, just append it.
@@ -88,8 +86,8 @@ static void AddFastCallStdCallSuffix(Sma
 /// and the specified global variable's name.  If the global variable doesn't
 /// have a name, this fills in a unique name for the global.
 void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
-                                const GlobalValue *GV, bool isImplicitlyPrivate,
-                                bool UseGlobalPrefix) {
+                                const GlobalValue *GV,
+                                bool isImplicitlyPrivate) {
   ManglerPrefixTy PrefixTy = Mangler::Default;
   if (GV->hasPrivateLinkage() || isImplicitlyPrivate)
     PrefixTy = Mangler::Private;
@@ -99,7 +97,7 @@ void Mangler::getNameWithPrefix(SmallVec
   // If this global has a name, handle it simply.
   if (GV->hasName()) {
     StringRef Name = GV->getName();
-    getNameWithPrefix(OutName, Name, PrefixTy, UseGlobalPrefix);
+    getNameWithPrefix(OutName, Name, PrefixTy);
     // No need to do anything else if the global has the special "do not mangle"
     // flag in the name.
     if (Name[0] == 1)
@@ -111,8 +109,7 @@ void Mangler::getNameWithPrefix(SmallVec
     if (ID == 0) ID = NextAnonGlobalID++;
   
     // Must mangle the global into a unique ID.
-    getNameWithPrefix(OutName, "__unnamed_" + Twine(ID), PrefixTy,
-                      UseGlobalPrefix);
+    getNameWithPrefix(OutName, "__unnamed_" + Twine(ID), PrefixTy);
   }
   
   // If we are supposed to add a microsoft-style suffix for stdcall/fastcall,





More information about the llvm-commits mailing list