summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp9
-rw-r--r--llvm/lib/IR/Mangler.cpp10
2 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 10729cd81a5..5a8367eea77 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -960,8 +960,13 @@ void TargetLoweringObjectFileCOFF::getNameWithPrefix(
((isa<Function>(GV) && TM.getFunctionSections()) ||
(isa<GlobalVariable>(GV) && TM.getDataSections()))) {
SmallString<256> Tmp;
- Mang.getNameWithPrefix(Tmp, GV, CannotUsePrivateLabel, /*ForceNonPrivate=*/true);
- OutName.append(Tmp.begin(), Tmp.end());
+ Mang.getNameWithPrefix(Tmp, GV, /*CannotUsePrivateLabel=*/false);
+ if (Tmp.startswith(".L"))
+ OutName.append(Tmp.begin() + 2, Tmp.end());
+ else if (Tmp.startswith("L"))
+ OutName.append(Tmp.begin() + 1, Tmp.end());
+ else
+ OutName.append(Tmp.begin(), Tmp.end());
return;
}
Mang.getNameWithPrefix(OutName, GV, CannotUsePrivateLabel);
diff --git a/llvm/lib/IR/Mangler.cpp b/llvm/lib/IR/Mangler.cpp
index 2ba5998c805..a0e1b25056c 100644
--- a/llvm/lib/IR/Mangler.cpp
+++ b/llvm/lib/IR/Mangler.cpp
@@ -91,10 +91,9 @@ static void addByteCountSuffix(raw_ostream &OS, const Function *F,
}
void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV,
- bool CannotUsePrivateLabel,
- bool ForceNonPrivate) const {
+ bool CannotUsePrivateLabel) const {
ManglerPrefixTy PrefixTy = Mangler::Default;
- if (GV->hasPrivateLinkage() && !ForceNonPrivate) {
+ if (GV->hasPrivateLinkage()) {
if (CannotUsePrivateLabel)
PrefixTy = Mangler::LinkerPrivate;
else
@@ -153,8 +152,7 @@ void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV,
void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
const GlobalValue *GV,
- bool CannotUsePrivateLabel,
- bool ForceNonPrivate) const {
+ bool CannotUsePrivateLabel) const {
raw_svector_ostream OS(OutName);
- getNameWithPrefix(OS, GV, CannotUsePrivateLabel, ForceNonPrivate);
+ getNameWithPrefix(OS, GV, CannotUsePrivateLabel);
}
OpenPOWER on IntegriCloud