[llvm] r281981 - Remove extra argument used once on TargetMachine::getNameWithPrefix and inline the result into the singular caller.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 09:04:51 PDT 2016


Author: echristo
Date: Tue Sep 20 11:04:50 2016
New Revision: 281981

URL: http://llvm.org/viewvc/llvm-project?rev=281981&view=rev
Log:
Remove extra argument used once on TargetMachine::getNameWithPrefix and inline the result into the singular caller.

Modified:
    llvm/trunk/include/llvm/Target/TargetMachine.h
    llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    llvm/trunk/lib/Target/TargetMachine.cpp

Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=281981&r1=281980&r2=281981&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Tue Sep 20 11:04:50 2016
@@ -265,7 +265,7 @@ public:
   virtual bool targetSchedulesPostRAScheduling() const { return false; };
 
   void getNameWithPrefix(SmallVectorImpl<char> &Name, const GlobalValue *GV,
-                         Mangler &Mang, bool MayAlwaysUsePrivate = false) const;
+                         Mangler &Mang) const;
   MCSymbol *getSymbol(const GlobalValue *GV, Mangler &Mang) const;
 
   /// True if the target uses physical regs at Prolog/Epilog insertion

Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=281981&r1=281980&r2=281981&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Tue Sep 20 11:04:50 2016
@@ -296,7 +296,7 @@ selectELFSectionForGlobal(MCContext &Ctx
 
   if (EmitUniqueSection && UniqueSectionNames) {
     Name.push_back('.');
-    TM.getNameWithPrefix(Name, GV, Mang, true);
+    Mang.getNameWithPrefix(Name, GV, false);
   }
   unsigned UniqueID = MCContext::GenericSectionID;
   if (EmitUniqueSection && !UniqueSectionNames) {

Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=281981&r1=281980&r2=281981&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Tue Sep 20 11:04:50 2016
@@ -199,9 +199,8 @@ TargetIRAnalysis TargetMachine::getTarge
 }
 
 void TargetMachine::getNameWithPrefix(SmallVectorImpl<char> &Name,
-                                      const GlobalValue *GV, Mangler &Mang,
-                                      bool MayAlwaysUsePrivate) const {
-  if (MayAlwaysUsePrivate || !GV->hasPrivateLinkage()) {
+                                      const GlobalValue *GV, Mangler &Mang) const {
+  if (!GV->hasPrivateLinkage()) {
     // Simple case: If GV is not private, it is not important to find out if
     // private labels are legal in this case or not.
     Mang.getNameWithPrefix(Name, GV, false);




More information about the llvm-commits mailing list