[llvm] r269013 - TargetPassConfig: Set PrintMachineCode even if addMachinePasses() does not run.
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon May 9 21:51:04 PDT 2016
Author: matze
Date: Mon May 9 23:51:04 2016
New Revision: 269013
URL: http://llvm.org/viewvc/llvm-project?rev=269013&view=rev
Log:
TargetPassConfig: Set PrintMachineCode even if addMachinePasses() does not run.
Modified:
llvm/trunk/lib/CodeGen/TargetPassConfig.cpp
Modified: llvm/trunk/lib/CodeGen/TargetPassConfig.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetPassConfig.cpp?rev=269013&r1=269012&r2=269013&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetPassConfig.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetPassConfig.cpp Mon May 9 23:51:04 2016
@@ -258,6 +258,9 @@ TargetPassConfig::TargetPassConfig(Targe
// Substitute Pseudo Pass IDs for real ones.
substitutePass(&EarlyTailDuplicateID, &TailDuplicateID);
substitutePass(&PostRAMachineLICMID, &MachineLICMID);
+
+ if (StringRef(PrintMachineInstrs.getValue()).equals(""))
+ TM->Options.PrintMachineCode = true;
}
CodeGenOpt::Level TargetPassConfig::getOptLevel() const {
@@ -519,11 +522,8 @@ void TargetPassConfig::addMachinePasses(
AddingMachinePasses = true;
// Insert a machine instr printer pass after the specified pass.
- // If -print-machineinstrs specified, print machineinstrs after all passes.
- if (StringRef(PrintMachineInstrs.getValue()).equals(""))
- TM->Options.PrintMachineCode = true;
- else if (!StringRef(PrintMachineInstrs.getValue())
- .equals("option-unspecified")) {
+ if (!StringRef(PrintMachineInstrs.getValue()).equals("") &&
+ !StringRef(PrintMachineInstrs.getValue()).equals("option-unspecified")) {
const PassRegistry *PR = PassRegistry::getPassRegistry();
const PassInfo *TPI = PR->getPassInfo(PrintMachineInstrs.getValue());
const PassInfo *IPI = PR->getPassInfo(StringRef("machineinstr-printer"));
More information about the llvm-commits
mailing list