From a5ced5ed37b3a742e958506ce133387b3313fe3a Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 12 Jan 2014 11:30:46 +0000 Subject: [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199044 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/IRPrintingPasses.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'lib/IR/IRPrintingPasses.cpp') diff --git a/lib/IR/IRPrintingPasses.cpp b/lib/IR/IRPrintingPasses.cpp index 4398a9cfd2..242dcff795 100644 --- a/lib/IR/IRPrintingPasses.cpp +++ b/lib/IR/IRPrintingPasses.cpp @@ -113,20 +113,17 @@ char PrintBasicBlockPass::ID = 0; INITIALIZE_PASS(PrintBasicBlockPass, "print-bb", "Print BB to stderr", false, false) -ModulePass *llvm::createPrintModulePass(llvm::raw_ostream *OS, - bool DeleteStream, +ModulePass *llvm::createPrintModulePass(llvm::raw_ostream &OS, const std::string &Banner) { - return new PrintModulePass(Banner, OS, DeleteStream); + return new PrintModulePass(Banner, &OS, false); } -FunctionPass *llvm::createPrintFunctionPass(const std::string &Banner, - llvm::raw_ostream *OS, - bool DeleteStream) { - return new PrintFunctionPass(Banner, OS, DeleteStream); +FunctionPass *llvm::createPrintFunctionPass(llvm::raw_ostream &OS, + const std::string &Banner) { + return new PrintFunctionPass(Banner, &OS, false); } -BasicBlockPass *llvm::createPrintBasicBlockPass(llvm::raw_ostream *OS, - bool DeleteStream, +BasicBlockPass *llvm::createPrintBasicBlockPass(llvm::raw_ostream &OS, const std::string &Banner) { - return new PrintBasicBlockPass(Banner, OS, DeleteStream); + return new PrintBasicBlockPass(Banner, &OS, false); } -- cgit v1.2.3