mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
helper method, use it to simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93575 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1698,6 +1698,22 @@ MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
|
||||
return OutContext.GetOrCreateSymbol(Name.str());
|
||||
}
|
||||
|
||||
/// GetGlobalValueSymbol - Return the MCSymbol for the specified global
|
||||
/// value.
|
||||
MCSymbol *AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const {
|
||||
SmallString<60> NameStr;
|
||||
Mang->getNameWithPrefix(NameStr, GV, false);
|
||||
return OutContext.GetOrCreateSymbol(NameStr.str());
|
||||
}
|
||||
|
||||
/// GetExternalSymbolSymbol - Return the MCSymbol for the specified
|
||||
/// ExternalSymbol.
|
||||
MCSymbol *AsmPrinter::GetExternalSymbolSymbol(StringRef Sym) const {
|
||||
SmallString<60> NameStr;
|
||||
Mang->getNameWithPrefix(NameStr, Sym);
|
||||
return OutContext.GetOrCreateSymbol(NameStr.str());
|
||||
}
|
||||
|
||||
|
||||
/// EmitBasicBlockStart - This method prints the label for the specified
|
||||
/// MachineBasicBlock, an alignment (if present) and a comment describing
|
||||
|
Reference in New Issue
Block a user