add another helper

llvm-svn: 93577
This commit is contained in:
Chris Lattner 2010-01-15 23:25:11 +00:00
parent e52529d7cb
commit e293db0c8a
2 changed files with 17 additions and 0 deletions

View File

@ -343,6 +343,12 @@ namespace llvm {
/// value.
MCSymbol *GetGlobalValueSymbol(const GlobalValue *GV) const;
/// GetPrivateGlobalValueSymbolStub - Return the MCSymbol for a symbol with
/// global value name as its base, with the specified suffix, and where the
/// symbol is forced to have private linkage.
MCSymbol *GetPrivateGlobalValueSymbolStub(const GlobalValue *GV,
StringRef Suffix) const;
/// GetExternalSymbolSymbol - Return the MCSymbol for the specified
/// ExternalSymbol.
MCSymbol *GetExternalSymbolSymbol(StringRef Sym) const;

View File

@ -1706,6 +1706,17 @@ MCSymbol *AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const {
return OutContext.GetOrCreateSymbol(NameStr.str());
}
/// GetPrivateGlobalValueSymbolStub - Return the MCSymbol for a symbol with
/// global value name as its base, with the specified suffix, and where the
/// symbol is forced to have private linkage.
MCSymbol *AsmPrinter::GetPrivateGlobalValueSymbolStub(const GlobalValue *GV,
StringRef Suffix) const {
SmallString<60> NameStr;
Mang->getNameWithPrefix(NameStr, GV, true);
NameStr.append(Suffix.begin(), Suffix.end());
return OutContext.GetOrCreateSymbol(NameStr.str());
}
/// GetExternalSymbolSymbol - Return the MCSymbol for the specified
/// ExternalSymbol.
MCSymbol *AsmPrinter::GetExternalSymbolSymbol(StringRef Sym) const {