diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-05 05:53:12 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-05 05:53:12 +0000 |
commit | fac7a9e644f557e0cf75bab1faf7b762395ce1cb (patch) | |
tree | 29e89f5f12c82c44dc04b11a2f1880c11f8fce7c /lib/Target/TargetLoweringObjectFile.cpp | |
parent | 087ab613f42890b2e84fb8a058f346ead2bfd595 (diff) | |
download | llvm-fac7a9e644f557e0cf75bab1faf7b762395ce1cb.tar.gz llvm-fac7a9e644f557e0cf75bab1faf7b762395ce1cb.tar.bz2 llvm-fac7a9e644f557e0cf75bab1faf7b762395ce1cb.tar.xz |
Remove the isImplicitlyPrivate argument of getNameWithPrefix.
getSymbolWithGlobalValueBase use is to create a name of a new symbol based
on the name of an existing GV. Assert that and then remove the last call
to pass true to isImplicitlyPrivate.
This gives the mangler API a 1:1 mapping from GV to names, which is what we
need to drop the mangler dependency on the target (and use an extended
datalayout instead).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index 836edeb5a2..66a52d6aa3 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/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()); } |