aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index aa1916b..17caed9 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -199,8 +199,16 @@ TargetIRAnalysis TargetMachine::getTargetIRAnalysis() {
}
void TargetMachine::getNameWithPrefix(SmallVectorImpl<char> &Name,
- const GlobalValue *GV, Mangler &Mang) const {
- getObjFileLowering()->getNameWithPrefix(Name, GV, *this);
+ const GlobalValue *GV, Mangler &Mang,
+ bool MayAlwaysUsePrivate) const {
+ if (MayAlwaysUsePrivate || !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);
}
MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {