mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
Remove the DisasmEnabled AsmPrinter variable and just look it
up on the subtarget where it's set anyhow than looking it up 2-3 times in the same place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229802 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d93ca09fe0
commit
2b8ccbf2ad
@ -86,9 +86,7 @@ extern "C" void LLVMInitializeR600AsmPrinter() {
|
||||
|
||||
AMDGPUAsmPrinter::AMDGPUAsmPrinter(TargetMachine &TM,
|
||||
std::unique_ptr<MCStreamer> Streamer)
|
||||
: AsmPrinter(TM, std::move(Streamer)) {
|
||||
DisasmEnabled = TM.getSubtarget<AMDGPUSubtarget>().dumpCode();
|
||||
}
|
||||
: AsmPrinter(TM, std::move(Streamer)) {}
|
||||
|
||||
void AMDGPUAsmPrinter::EmitEndOfAsmFile(Module &M) {
|
||||
|
||||
@ -160,7 +158,7 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
}
|
||||
}
|
||||
|
||||
if (STM.dumpCode() && DisasmEnabled) {
|
||||
if (STM.dumpCode()) {
|
||||
|
||||
OutStreamer.SwitchSection(
|
||||
Context.getELFSection(".AMDGPU.disasm", ELF::SHT_NOTE, 0));
|
||||
|
@ -100,7 +100,6 @@ public:
|
||||
void EmitEndOfAsmFile(Module &M) override;
|
||||
|
||||
protected:
|
||||
bool DisasmEnabled;
|
||||
std::vector<std::string> DisasmLines, HexLines;
|
||||
size_t DisasmLineMaxLen;
|
||||
};
|
||||
|
@ -116,7 +116,7 @@ void AMDGPUAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
MCInstLowering.lower(MI, TmpInst);
|
||||
EmitToStreamer(OutStreamer, TmpInst);
|
||||
|
||||
if (DisasmEnabled) {
|
||||
if (MF->getSubtarget<AMDGPUSubtarget>().dumpCode()) {
|
||||
// Disassemble instruction/operands to text.
|
||||
DisasmLines.resize(DisasmLines.size() + 1);
|
||||
std::string &DisasmLine = DisasmLines.back();
|
||||
|
Loading…
Reference in New Issue
Block a user