Fix a hidden use of grabbing the Mangler from the AsmPrinter and update

accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281748 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2016-09-16 17:07:13 +00:00
parent 8dff0d8b85
commit 7bbc777d2e

View File

@ -34,10 +34,10 @@ static MachineModuleInfoMachO &getMachOMMI(AsmPrinter &AP) {
return AP.MMI->getObjFileInfo<MachineModuleInfoMachO>(); return AP.MMI->getObjFileInfo<MachineModuleInfoMachO>();
} }
static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO,
static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){ AsmPrinter &AP) {
const TargetMachine &TM = AP.TM; const TargetMachine &TM = AP.TM;
Mangler *Mang = AP.Mang; Mangler &Mang = TM.getObjFileLowering()->getMangler();
const DataLayout &DL = AP.getDataLayout(); const DataLayout &DL = AP.getDataLayout();
MCContext &Ctx = AP.OutContext; MCContext &Ctx = AP.OutContext;
@ -54,7 +54,7 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){
Mangler::getNameWithPrefix(Name, MO.getSymbolName(), DL); Mangler::getNameWithPrefix(Name, MO.getSymbolName(), DL);
} else { } else {
const GlobalValue *GV = MO.getGlobal(); const GlobalValue *GV = MO.getGlobal();
TM.getNameWithPrefix(Name, GV, *Mang); TM.getNameWithPrefix(Name, GV, Mang);
} }
Name += Suffix; Name += Suffix;