mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-18 17:38:30 +00:00
inline the now-trivial implementation of GetGlobalValueSymbol into
some of its callers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98388 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b6fc4a5650
commit
deb0cba1ba
@ -193,7 +193,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
||||
if (EmitSpecialLLVMGlobal(GV))
|
||||
return;
|
||||
|
||||
MCSymbol *GVSym = GetGlobalValueSymbol(GV);
|
||||
MCSymbol *GVSym = Mang->getSymbol(GV);
|
||||
EmitVisibility(GVSym, GV->getVisibility());
|
||||
|
||||
if (MAI->hasDotTypeDotSizeDirective())
|
||||
@ -477,14 +477,12 @@ bool AsmPrinter::doFinalization(Module &M) {
|
||||
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ++I) {
|
||||
if (!I->hasExternalWeakLinkage()) continue;
|
||||
OutStreamer.EmitSymbolAttribute(GetGlobalValueSymbol(I),
|
||||
MCSA_WeakReference);
|
||||
OutStreamer.EmitSymbolAttribute(Mang->getSymbol(I), MCSA_WeakReference);
|
||||
}
|
||||
|
||||
for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I) {
|
||||
if (!I->hasExternalWeakLinkage()) continue;
|
||||
OutStreamer.EmitSymbolAttribute(GetGlobalValueSymbol(I),
|
||||
MCSA_WeakReference);
|
||||
OutStreamer.EmitSymbolAttribute(Mang->getSymbol(I), MCSA_WeakReference);
|
||||
}
|
||||
}
|
||||
|
||||
@ -492,10 +490,10 @@ bool AsmPrinter::doFinalization(Module &M) {
|
||||
OutStreamer.AddBlankLine();
|
||||
for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
|
||||
I != E; ++I) {
|
||||
MCSymbol *Name = GetGlobalValueSymbol(I);
|
||||
MCSymbol *Name = Mang->getSymbol(I);
|
||||
|
||||
const GlobalValue *GV = cast<GlobalValue>(I->getAliasedGlobal());
|
||||
MCSymbol *Target = GetGlobalValueSymbol(GV);
|
||||
MCSymbol *Target = Mang->getSymbol(GV);
|
||||
|
||||
if (I->hasExternalLinkage() || !MAI->getWeakRefDirective())
|
||||
OutStreamer.EmitSymbolAttribute(Name, MCSA_Global);
|
||||
@ -539,7 +537,7 @@ bool AsmPrinter::doFinalization(Module &M) {
|
||||
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
|
||||
this->MF = &MF;
|
||||
// Get the function symbol.
|
||||
CurrentFnSym = GetGlobalValueSymbol(MF.getFunction());
|
||||
CurrentFnSym = Mang->getSymbol(MF.getFunction());
|
||||
|
||||
if (VerboseAsm)
|
||||
LI = &getAnalysis<MachineLoopInfo>();
|
||||
@ -845,8 +843,7 @@ void AsmPrinter::EmitLLVMUsedList(Constant *List) {
|
||||
const GlobalValue *GV =
|
||||
dyn_cast<GlobalValue>(InitList->getOperand(i)->stripPointerCasts());
|
||||
if (GV && getObjFileLowering().shouldEmitUsedDirectiveFor(GV, Mang))
|
||||
OutStreamer.EmitSymbolAttribute(GetGlobalValueSymbol(GV),
|
||||
MCSA_NoDeadStrip);
|
||||
OutStreamer.EmitSymbolAttribute(Mang->getSymbol(GV), MCSA_NoDeadStrip);
|
||||
}
|
||||
}
|
||||
|
||||
@ -963,7 +960,7 @@ static const MCExpr *LowerConstant(const Constant *CV, AsmPrinter &AP) {
|
||||
return MCConstantExpr::Create(CI->getZExtValue(), Ctx);
|
||||
|
||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV))
|
||||
return MCSymbolRefExpr::Create(AP.GetGlobalValueSymbol(GV), Ctx);
|
||||
return MCSymbolRefExpr::Create(AP.Mang->getSymbol(GV), Ctx);
|
||||
if (const BlockAddress *BA = dyn_cast<BlockAddress>(CV))
|
||||
return MCSymbolRefExpr::Create(AP.GetBlockAddressSymbol(BA), Ctx);
|
||||
|
||||
|
@ -1693,7 +1693,7 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
|
||||
DIEBlock *Block = new DIEBlock();
|
||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
|
||||
addLabel(Block, 0, dwarf::DW_FORM_udata,
|
||||
Asm->GetGlobalValueSymbol(DI_GV.getGlobal()));
|
||||
Asm->Mang->getSymbol(DI_GV.getGlobal()));
|
||||
addBlock(VariableSpecDIE, dwarf::DW_AT_location, 0, Block);
|
||||
addUInt(VariableDie, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1);
|
||||
ModuleCU->addDie(VariableSpecDIE);
|
||||
@ -1701,7 +1701,7 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
|
||||
DIEBlock *Block = new DIEBlock();
|
||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
|
||||
addLabel(Block, 0, dwarf::DW_FORM_udata,
|
||||
Asm->GetGlobalValueSymbol(DI_GV.getGlobal()));
|
||||
Asm->Mang->getSymbol(DI_GV.getGlobal()));
|
||||
addBlock(VariableDie, dwarf::DW_AT_location, 0, Block);
|
||||
}
|
||||
addToContextOwner(VariableDie, GVContext);
|
||||
|
@ -100,7 +100,7 @@ void X86AsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
||||
MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE)
|
||||
GVSym = GetSymbolWithGlobalValueBase(GV, "$non_lazy_ptr");
|
||||
else
|
||||
GVSym = GetGlobalValueSymbol(GV);
|
||||
GVSym = Mang->getSymbol(GV);
|
||||
|
||||
// Handle dllimport linkage.
|
||||
if (MO.getTargetFlags() == X86II::MO_DLLIMPORT)
|
||||
@ -113,21 +113,21 @@ void X86AsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
||||
MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry(Sym);
|
||||
if (StubSym.getPointer() == 0)
|
||||
StubSym = MachineModuleInfoImpl::
|
||||
StubValueTy(GetGlobalValueSymbol(GV), !GV->hasInternalLinkage());
|
||||
StubValueTy(Mang->getSymbol(GV), !GV->hasInternalLinkage());
|
||||
} else if (MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE){
|
||||
MCSymbol *Sym = GetSymbolWithGlobalValueBase(GV, "$non_lazy_ptr");
|
||||
MachineModuleInfoImpl::StubValueTy &StubSym =
|
||||
MMI->getObjFileInfo<MachineModuleInfoMachO>().getHiddenGVStubEntry(Sym);
|
||||
if (StubSym.getPointer() == 0)
|
||||
StubSym = MachineModuleInfoImpl::
|
||||
StubValueTy(GetGlobalValueSymbol(GV), !GV->hasInternalLinkage());
|
||||
StubValueTy(Mang->getSymbol(GV), !GV->hasInternalLinkage());
|
||||
} else if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
|
||||
MCSymbol *Sym = GetSymbolWithGlobalValueBase(GV, "$stub");
|
||||
MachineModuleInfoImpl::StubValueTy &StubSym =
|
||||
MMI->getObjFileInfo<MachineModuleInfoMachO>().getFnStubEntry(Sym);
|
||||
if (StubSym.getPointer() == 0)
|
||||
StubSym = MachineModuleInfoImpl::
|
||||
StubValueTy(GetGlobalValueSymbol(GV), !GV->hasInternalLinkage());
|
||||
StubValueTy(Mang->getSymbol(GV), !GV->hasInternalLinkage());
|
||||
}
|
||||
|
||||
// If the name begins with a dollar-sign, enclose it in parens. We do this
|
||||
@ -574,15 +574,13 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
|
||||
static_cast<TargetLoweringObjectFileCOFF&>(getObjFileLowering());
|
||||
|
||||
for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
|
||||
if (I->hasDLLExportLinkage()) {
|
||||
MCSymbol *Sym = GetGlobalValueSymbol(I);
|
||||
DLLExportedFns.push_back(Sym);
|
||||
}
|
||||
if (I->hasDLLExportLinkage())
|
||||
DLLExportedFns.push_back(Mang->getSymbol(I));
|
||||
|
||||
for (Module::const_global_iterator I = M.global_begin(),
|
||||
E = M.global_end(); I != E; ++I)
|
||||
if (I->hasDLLExportLinkage())
|
||||
DLLExportedGlobals.push_back(GetGlobalValueSymbol(I));
|
||||
DLLExportedGlobals.push_back(Mang->getSymbol(I));
|
||||
|
||||
// Output linker support code for dllexported globals on windows.
|
||||
if (!DLLExportedGlobals.empty() || !DLLExportedFns.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user