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 | 117b20c4922c35704ffd139eec978328e0b32ad2 (patch) | |
tree | a2c2e36a6e01b978143eb4c030ea39fecc665c75 /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | f907b891da1641034f0603b0c6bc00b7aa4d1f4a (diff) | |
download | bcm5719-llvm-117b20c4922c35704ffd139eec978328e0b32ad2.tar.gz bcm5719-llvm-117b20c4922c35704ffd139eec978328e0b32ad2.zip |
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).
llvm-svn: 196472
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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()); } |