]> granicus.if.org Git - llvm/commitdiff
Remove more guts of TargetMachine::getNameWithPrefix and migrate one check to the...
authorEric Christopher <echristo@gmail.com>
Tue, 20 Sep 2016 16:05:02 +0000 (16:05 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 20 Sep 2016 16:05:02 +0000 (16:05 +0000)
NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281983 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/Target/TargetMachine.cpp

index b92ffde231981f09eeb5e0ad1ee71f453243b4bd..218b45c9e747d9ef478c8142de5c908f453da772 100644 (file)
@@ -812,6 +812,13 @@ static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo,
 void TargetLoweringObjectFileMachO::getNameWithPrefix(
     SmallVectorImpl<char> &OutName, const GlobalValue *GV,
     const TargetMachine &TM) 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.
+    getMangler().getNameWithPrefix(OutName, GV, false);
+    return;
+  }
+
   SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
   const MCSection *TheSection = SectionForGlobal(GV, GVKind, TM);
   bool CannotUsePrivateLabel =
index 47c5a56ce09ce3d2283fc69881b605d47a7a1b53..aa1916bb2eb476b9990d03cc617123f9d46e0ba3 100644 (file)
@@ -200,14 +200,7 @@ TargetIRAnalysis TargetMachine::getTargetIRAnalysis() {
 
 void TargetMachine::getNameWithPrefix(SmallVectorImpl<char> &Name,
                                       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);
-    return;
-  }
-  const TargetLoweringObjectFile *TLOF = getObjFileLowering();
-  TLOF->getNameWithPrefix(Name, GV, *this);
+  getObjFileLowering()->getNameWithPrefix(Name, GV, *this);
 }
 
 MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {