summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Mangler.cpp5
-rw-r--r--llvm/lib/Target/PowerPC/PPCMCInstLower.cpp2
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp12
-rw-r--r--llvm/lib/Target/X86/X86MCInstLower.cpp2
4 files changed, 14 insertions, 7 deletions
diff --git a/llvm/lib/Target/Mangler.cpp b/llvm/lib/Target/Mangler.cpp
index c41a0f3591b..f90cd7849a4 100644
--- a/llvm/lib/Target/Mangler.cpp
+++ b/llvm/lib/Target/Mangler.cpp
@@ -81,10 +81,9 @@ static void AddFastCallStdCallSuffix(SmallVectorImpl<char> &OutName,
/// and the specified global variable's name. If the global variable doesn't
/// have a name, this fills in a unique name for the global.
void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
- const GlobalValue *GV,
- bool isImplicitlyPrivate) {
+ const GlobalValue *GV) {
ManglerPrefixTy PrefixTy = Mangler::Default;
- if (GV->hasPrivateLinkage() || isImplicitlyPrivate)
+ if (GV->hasPrivateLinkage())
PrefixTy = Mangler::Private;
else if (GV->hasLinkerPrivateLinkage() || GV->hasLinkerPrivateWeakLinkage())
PrefixTy = Mangler::LinkerPrivate;
diff --git a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
index 1cbd268791d..56fa773433a 100644
--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
@@ -51,7 +51,7 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){
AP.Mang->getNameWithPrefix(Name, MO.getSymbolName());
} else {
const GlobalValue *GV = MO.getGlobal();
- AP.Mang->getNameWithPrefix(Name, GV, false);
+ AP.Mang->getNameWithPrefix(Name, GV);
}
unsigned OrigLen = Name.size() - PrefixLen;
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 836edeb5a2a..66a52d6aa3c 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -18,6 +18,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCStreamer.h"
@@ -102,14 +103,21 @@ static bool IsNullTerminatedString(const Constant *C) {
MCSymbol *TargetLoweringObjectFile::getSymbol(Mangler &M,
const GlobalValue *GV) const {
SmallString<60> NameStr;
- M.getNameWithPrefix(NameStr, GV, false);
+ M.getNameWithPrefix(NameStr, GV);
return Ctx->GetOrCreateSymbol(NameStr.str());
}
MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase(
Mangler &M, const GlobalValue *GV, StringRef Suffix) const {
+ assert(!Suffix.empty());
+ assert(!GV->hasPrivateLinkage());
+ assert(!GV->hasLinkerPrivateLinkage());
+ assert(!GV->hasLinkerPrivateWeakLinkage());
+
+ const MCAsmInfo *MAI = Ctx->getAsmInfo();
SmallString<60> NameStr;
- M.getNameWithPrefix(NameStr, GV, true);
+ NameStr += MAI->getPrivateGlobalPrefix();
+ M.getNameWithPrefix(NameStr, GV);
NameStr.append(Suffix.begin(), Suffix.end());
return Ctx->GetOrCreateSymbol(NameStr.str());
}
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index 305dc953928..78d45e88290 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -97,7 +97,7 @@ GetSymbolFromOperand(const MachineOperand &MO) const {
if (MO.isGlobal()) {
const GlobalValue *GV = MO.getGlobal();
- getMang()->getNameWithPrefix(Name, GV, false);
+ getMang()->getNameWithPrefix(Name, GV);
} else if (MO.isSymbol()) {
getMang()->getNameWithPrefix(Name, MO.getSymbolName());
} else if (MO.isMBB()) {
OpenPOWER on IntegriCloud