mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-08 19:36:02 +00:00
use Mang->getSymbol instead of duplicating the logic, reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
73ff564d65
commit
2341f6ccf8
@ -54,25 +54,19 @@ void X86AsmPrinter::PrintPICBaseSymbol() const {
|
||||
}
|
||||
|
||||
MCSymbol *X86AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const {
|
||||
SmallString<60> NameStr;
|
||||
Mang->getNameWithPrefix(NameStr, GV, false);
|
||||
MCSymbol *Symb;
|
||||
if (GV->hasPrivateLinkage())
|
||||
Symb = OutContext.GetOrCreateTemporarySymbol(NameStr.str());
|
||||
else
|
||||
Symb = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||
MCSymbol *Symb = Mang->getSymbol(GV);
|
||||
|
||||
if (!Subtarget->isTargetCygMing() || !isa<Function>(GV))
|
||||
return Symb;
|
||||
|
||||
X86COFFMachineModuleInfo &COFFMMI =
|
||||
MMI->getObjFileInfo<X86COFFMachineModuleInfo>();
|
||||
COFFMMI.DecorateCygMingName(Symb, OutContext, GV, *TM.getTargetData());
|
||||
|
||||
if (Subtarget->isTargetCygMing()) {
|
||||
X86COFFMachineModuleInfo &COFFMMI =
|
||||
MMI->getObjFileInfo<X86COFFMachineModuleInfo>();
|
||||
COFFMMI.DecorateCygMingName(Symb, OutContext, GV, *TM.getTargetData());
|
||||
|
||||
// Save function name for later type emission.
|
||||
if (const Function *F = dyn_cast<Function>(GV))
|
||||
if (F->isDeclaration())
|
||||
COFFMMI.addExternalFunction(Symb->getName());
|
||||
|
||||
}
|
||||
// Save function name for later type emission.
|
||||
const Function *F = cast<Function>(GV);
|
||||
if (F->isDeclaration())
|
||||
COFFMMI.addExternalFunction(Symb->getName());
|
||||
|
||||
return Symb;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user