diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-01-12 11:30:46 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-01-12 11:30:46 +0000 |
commit | 9d805139bdf016787c4d66619b17a2fff2c5392c (patch) | |
tree | 22e3dadb68961cff98013382789a4c3549d797a8 /llvm/lib/CodeGen | |
parent | 3dd261d0c94d949b75e82cd581a0b5cd50aee9b6 (diff) | |
download | bcm5719-llvm-9d805139bdf016787c4d66619b17a2fff2c5392c.tar.gz bcm5719-llvm-9d805139bdf016787c4d66619b17a2fff2c5392c.zip |
[PM] Simplify the interface exposed for IR printing passes.
Nothing was using the ability of the pass to delete the raw_ostream it
printed to, and nothing was trying to pass it a pointer to the
raw_ostream. Also, the function variant had a different order of
arguments from all of the others which was just really confusing. Now
the interface accepts a reference, doesn't offer to delete it, and uses
a consistent order. The implementation of the printing passes haven't
been updated with this simplification, this is just the API switch.
llvm-svn: 199044
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/Passes.cpp | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index be90d5d4bd5..9a7697e5378 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -154,7 +154,7 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, // machine-level pass), and whatever other information is needed to // deserialize the code and resume compilation. For now, just write the // LLVM IR. - PM.add(createPrintModulePass(&Out)); + PM.add(createPrintModulePass(Out)); return false; } diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp index dd9cb55b337..1ad9b73f41f 100644 --- a/llvm/lib/CodeGen/Passes.cpp +++ b/llvm/lib/CodeGen/Passes.cpp @@ -389,7 +389,7 @@ void TargetPassConfig::addIRPasses() { if (getOptLevel() != CodeGenOpt::None && !DisableLSR) { addPass(createLoopStrengthReducePass()); if (PrintLSR) - addPass(createPrintFunctionPass("\n\n*** Code after LSR ***\n", &dbgs())); + addPass(createPrintFunctionPass(dbgs(), "\n\n*** Code after LSR ***\n")); } addPass(createGCLoweringPass()); @@ -440,9 +440,8 @@ void TargetPassConfig::addISelPrepare() { addPass(createStackProtectorPass(TM)); if (PrintISelInput) - addPass(createPrintFunctionPass("\n\n" - "*** Final LLVM Code input to ISel ***\n", - &dbgs())); + addPass(createPrintFunctionPass( + dbgs(), "\n\n*** Final LLVM Code input to ISel ***\n")); // All passes which modify the LLVM IR are now complete; run the verifier // to ensure that the IR is valid. |