[llvm] r229802 - Remove the DisasmEnabled AsmPrinter variable and just look it
Eric Christopher
echristo at gmail.com
Wed Feb 18 17:10:49 PST 2015
Author: echristo
Date: Wed Feb 18 19:10:49 2015
New Revision: 229802
URL: http://llvm.org/viewvc/llvm-project?rev=229802&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp
llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.h
llvm/trunk/lib/Target/R600/AMDGPUMCInstLower.cpp
Modified: llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp?rev=229802&r1=229801&r2=229802&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.cpp Wed Feb 18 19:10:49 2015
@@ -86,9 +86,7 @@ extern "C" void LLVMInitializeR600AsmPri
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::runOnMachineFunct
}
}
- if (STM.dumpCode() && DisasmEnabled) {
+ if (STM.dumpCode()) {
OutStreamer.SwitchSection(
Context.getELFSection(".AMDGPU.disasm", ELF::SHT_NOTE, 0));
Modified: llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.h?rev=229802&r1=229801&r2=229802&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUAsmPrinter.h Wed Feb 18 19:10:49 2015
@@ -100,7 +100,6 @@ public:
void EmitEndOfAsmFile(Module &M) override;
protected:
- bool DisasmEnabled;
std::vector<std::string> DisasmLines, HexLines;
size_t DisasmLineMaxLen;
};
Modified: llvm/trunk/lib/Target/R600/AMDGPUMCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUMCInstLower.cpp?rev=229802&r1=229801&r2=229802&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUMCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUMCInstLower.cpp Wed Feb 18 19:10:49 2015
@@ -116,7 +116,7 @@ void AMDGPUAsmPrinter::EmitInstruction(c
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();
More information about the llvm-commits
mailing list