From 6129538ade6a3a49139ee5b34bbf993dc8c026f6 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Tue, 17 Mar 2015 20:40:21 +0000 Subject: [PATCH] Revert "Address review comments" This reverts commit r232540. This was committed accidently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232541 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Mangler.h | 6 ++---- lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 9 +++++++-- lib/IR/Mangler.cpp | 10 ++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/llvm/IR/Mangler.h b/include/llvm/IR/Mangler.h index b44d1c8c232..1e6b5b1dca0 100644 --- a/include/llvm/IR/Mangler.h +++ b/include/llvm/IR/Mangler.h @@ -52,11 +52,9 @@ public: /// If the global variable doesn't have a name, this fills in a unique name /// for the global. void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, - bool CannotUsePrivateLabel, - bool ForceNonPrivate = false) const; + bool CannotUsePrivateLabel) const; void getNameWithPrefix(SmallVectorImpl &OutName, const GlobalValue *GV, - bool CannotUsePrivateLabel, - bool ForceNonPrivate = false) const; + bool CannotUsePrivateLabel) const; /// Print the appropriate prefix and the specified name as the global variable /// name. GVName must not be empty. diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 10729cd81a5..5a8367eea77 100644 --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -960,8 +960,13 @@ void TargetLoweringObjectFileCOFF::getNameWithPrefix( ((isa(GV) && TM.getFunctionSections()) || (isa(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/lib/IR/Mangler.cpp b/lib/IR/Mangler.cpp index 2ba5998c805..a0e1b25056c 100644 --- a/lib/IR/Mangler.cpp +++ b/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 &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); } -- 2.40.0