mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Remove dead code.
MO_JumpTableIndex and MO_ExternalSymbol don't show up on inline asm. Keeping parts of the old asm printer just to print inline asm to a string that we then parse back looks like a hack. llvm-svn: 196111
This commit is contained in:
parent
a4c6fce65c
commit
cee11d6f43
@ -114,9 +114,6 @@ bool AArch64AsmPrinter::printSymbolicAddress(const MachineOperand &MO,
|
||||
case MachineOperand::MO_BlockAddress:
|
||||
Name = GetBlockAddressSymbol(MO.getBlockAddress())->getName();
|
||||
break;
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
Name = MO.getSymbolName();
|
||||
break;
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
Name = GetCPISymbol(MO.getIndex())->getName();
|
||||
break;
|
||||
@ -238,7 +235,6 @@ bool AArch64AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
|
||||
case MachineOperand::MO_BlockAddress:
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
return printSymbolicAddress(MO, false, "", O);
|
||||
}
|
||||
|
||||
|
@ -213,18 +213,9 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
||||
O << "(PLT)";
|
||||
break;
|
||||
}
|
||||
case MachineOperand::MO_ExternalSymbol: {
|
||||
O << *GetExternalSymbolSymbol(MO.getSymbolName());
|
||||
if (TF == ARMII::MO_PLT)
|
||||
O << "(PLT)";
|
||||
break;
|
||||
}
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
O << *GetCPISymbol(MO.getIndex());
|
||||
break;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << *GetJTISymbol(MO.getIndex());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,16 +76,9 @@ void HexagonAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
O << *MO.getMBB()->getSymbol();
|
||||
return;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << *GetJTISymbol(MO.getIndex());
|
||||
// FIXME: PIC relocation model.
|
||||
return;
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
O << *GetCPISymbol(MO.getIndex());
|
||||
return;
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
O << *GetExternalSymbolSymbol(MO.getSymbolName());
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
// Computing the address of a global symbol, not calling it.
|
||||
O << *getSymbol(MO.getGlobal());
|
||||
|
@ -99,14 +99,6 @@ void MSP430AsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
||||
|
||||
return;
|
||||
}
|
||||
case MachineOperand::MO_ExternalSymbol: {
|
||||
bool isMemOp = Modifier && !strcmp(Modifier, "mem");
|
||||
O << (isMemOp ? '&' : '#');
|
||||
SmallString<128> Name;
|
||||
Mang->getNameWithPrefix(Name, MO.getSymbolName());
|
||||
O << Name;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -542,15 +542,6 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
|
||||
break;
|
||||
}
|
||||
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
O << *GetExternalSymbolSymbol(MO.getSymbolName());
|
||||
break;
|
||||
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << MO.getIndex();
|
||||
break;
|
||||
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "CPI"
|
||||
<< getFunctionNumber() << "_" << MO.getIndex();
|
||||
|
@ -2087,21 +2087,6 @@ void NVPTXAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
|
||||
O << *getSymbol(MO.getGlobal());
|
||||
break;
|
||||
|
||||
case MachineOperand::MO_ExternalSymbol: {
|
||||
const char *symbname = MO.getSymbolName();
|
||||
if (strstr(symbname, ".PARAM") == symbname) {
|
||||
unsigned index;
|
||||
sscanf(symbname + 6, "%u[];", &index);
|
||||
printParamName(index, O);
|
||||
} else if (strstr(symbname, ".HLPPARAM") == symbname) {
|
||||
unsigned index;
|
||||
sscanf(symbname + 9, "%u[];", &index);
|
||||
O << *CurrentFnSym << "_param_" << index << "_offset";
|
||||
} else
|
||||
O << symbname;
|
||||
break;
|
||||
}
|
||||
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
O << *MO.getMBB()->getSymbol();
|
||||
return;
|
||||
|
@ -157,11 +157,6 @@ void PPCAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
O << *MO.getMBB()->getSymbol();
|
||||
return;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << MO.getIndex();
|
||||
// FIXME: PIC relocation model
|
||||
return;
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
|
||||
<< '_' << MO.getIndex();
|
||||
@ -169,25 +164,6 @@ void PPCAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
case MachineOperand::MO_BlockAddress:
|
||||
O << *GetBlockAddressSymbol(MO.getBlockAddress());
|
||||
return;
|
||||
case MachineOperand::MO_ExternalSymbol: {
|
||||
// Computing the address of an external symbol, not calling it.
|
||||
if (TM.getRelocationModel() == Reloc::Static) {
|
||||
O << *GetExternalSymbolSymbol(MO.getSymbolName());
|
||||
return;
|
||||
}
|
||||
|
||||
SmallString<128> Name;
|
||||
Mang->getNameWithPrefix(Name, Twine(MO.getSymbolName()) + "$non_lazy_ptr");
|
||||
MCSymbol *NLPSym = OutContext.GetOrCreateSymbol(Name);
|
||||
MachineModuleInfoImpl::StubValueTy &StubSym =
|
||||
MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry(NLPSym);
|
||||
if (StubSym.getPointer() == 0)
|
||||
StubSym = MachineModuleInfoImpl::
|
||||
StubValueTy(GetExternalSymbolSymbol(MO.getSymbolName()), true);
|
||||
|
||||
O << *NLPSym;
|
||||
return;
|
||||
}
|
||||
case MachineOperand::MO_GlobalAddress: {
|
||||
// Computing the address of a global symbol, not calling it.
|
||||
const GlobalValue *GV = MO.getGlobal();
|
||||
|
@ -218,17 +218,10 @@ void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
O << *getSymbol(MO.getGlobal());
|
||||
break;
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
O << MO.getSymbolName();
|
||||
break;
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber()
|
||||
<< '_' << MO.getIndex();
|
||||
break;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << MO.getIndex();
|
||||
break;
|
||||
case MachineOperand::MO_BlockAddress:
|
||||
O << *GetBlockAddressSymbol(MO.getBlockAddress());
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user