From: Chandler Carruth Date: Sun, 12 Jan 2014 11:10:32 +0000 (+0000) Subject: [PM] Rename the IR printing pass header to a more generic and correct X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8a5351f0f5123b9e36116ac1761b20c3a264ec09;p=oota-llvm.git [PM] Rename the IR printing pass header to a more generic and correct name to match the source file which I got earlier. Update the include sites. Also modernize the comments in the header to use the more recommended doxygen style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199041 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/IRPrintingPasses.h b/include/llvm/IR/IRPrintingPasses.h new file mode 100644 index 00000000000..45d3c7a120a --- /dev/null +++ b/include/llvm/IR/IRPrintingPasses.h @@ -0,0 +1,49 @@ +//===- IRPrintingPasses.h - Passes to print out IR constructs ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// +/// This file defines passes to print out IR in various granularities. The +/// PrintModulePass pass simply prints out the entire module when it is +/// executed. The PrintFunctionPass class is designed to be pipelined with +/// other FunctionPass's, and prints out the functions of the module as they +/// are processed. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_IR_PRINTMODULEPASS_H +#define LLVM_IR_PRINTMODULEPASS_H + +#include + +namespace llvm { +class FunctionPass; +class ModulePass; +class BasicBlockPass; +class raw_ostream; + +/// \brief Create and return a pass that writes the module to the specified +/// \c raw_ostream. +ModulePass *createPrintModulePass(raw_ostream *OS, bool DeleteStream = false, + const std::string &Banner = ""); + +/// \brief Create and return a pass that prints functions to the specified +/// \c raw_ostream as they are processed. +FunctionPass *createPrintFunctionPass(const std::string &Banner, + raw_ostream *OS, + bool DeleteStream = false); + +/// \brief Create and return a pass that writes the BB to the specified +/// \c raw_ostream. +BasicBlockPass *createPrintBasicBlockPass(raw_ostream *OS, + bool DeleteStream = false, + const std::string &Banner = ""); + +} // End llvm namespace + +#endif diff --git a/include/llvm/IR/PrintModulePass.h b/include/llvm/IR/PrintModulePass.h deleted file mode 100644 index 3c18bd59a0a..00000000000 --- a/include/llvm/IR/PrintModulePass.h +++ /dev/null @@ -1,48 +0,0 @@ -//===- PrintModulePass.h - IR Printing Passes -------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines two passes to print out a module. The PrintModulePass pass -// simply prints out the entire module when it is executed. The -// PrintFunctionPass class is designed to be pipelined with other -// FunctionPass's, and prints out the functions of the module as they are -// processed. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_IR_PRINTMODULEPASS_H -#define LLVM_IR_PRINTMODULEPASS_H - -#include - -namespace llvm { -class FunctionPass; -class ModulePass; -class BasicBlockPass; -class raw_ostream; - -/// createPrintModulePass - Create and return a pass that writes the -/// module to the specified raw_ostream. -ModulePass *createPrintModulePass(raw_ostream *OS, bool DeleteStream = false, - const std::string &Banner = ""); - -/// createPrintFunctionPass - Create and return a pass that prints -/// functions to the specified raw_ostream as they are processed. -FunctionPass *createPrintFunctionPass(const std::string &Banner, - raw_ostream *OS, - bool DeleteStream = false); - -/// createPrintBasicBlockPass - Create and return a pass that writes the -/// BB to the specified raw_ostream. -BasicBlockPass *createPrintBasicBlockPass(raw_ostream *OS, - bool DeleteStream = false, - const std::string &Banner = ""); - -} // End llvm namespace - -#endif diff --git a/include/llvm/LinkAllPasses.h b/include/llvm/LinkAllPasses.h index 106267acc16..6c8c5f7ffdb 100644 --- a/include/llvm/LinkAllPasses.h +++ b/include/llvm/LinkAllPasses.h @@ -28,7 +28,7 @@ #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/CodeGen/Passes.h" #include "llvm/IR/Function.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Instrumentation.h" #include "llvm/Transforms/ObjCARC.h" diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 3b08536c4ad..4775359c506 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -14,7 +14,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/LoopPass.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" using namespace llvm; diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 10c896b89a0..be90d5d4bd5 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -17,7 +17,7 @@ #include "llvm/CodeGen/MachineFunctionAnalysis.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/Passes.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstrInfo.h" diff --git a/lib/CodeGen/Passes.cpp b/lib/CodeGen/Passes.cpp index 22e72f45928..dd9cb55b337 100644 --- a/lib/CodeGen/Passes.cpp +++ b/lib/CodeGen/Passes.cpp @@ -18,7 +18,7 @@ #include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/RegAllocRegistry.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/PassManager.h" #include "llvm/Support/CommandLine.h" diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index cfe07ffba77..91684c9c70e 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -24,12 +24,12 @@ #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" -#include "llvm/IR/PrintModulePass.h" #include "llvm/IR/TypeFinder.h" #include "llvm/IR/ValueSymbolTable.h" #include "llvm/Support/CFG.h" diff --git a/lib/IR/IRPrintingPasses.cpp b/lib/IR/IRPrintingPasses.cpp index cf829232173..7240fd05807 100644 --- a/lib/IR/IRPrintingPasses.cpp +++ b/lib/IR/IRPrintingPasses.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/Function.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp index 85e50f753fc..ae94f05dcf4 100644 --- a/lib/IR/LegacyPassManager.cpp +++ b/lib/IR/LegacyPassManager.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/LegacyPassManagers.h" #include "llvm/IR/Module.h" diff --git a/lib/IR/Pass.cpp b/lib/IR/Pass.cpp index e9f43acfb3b..dc8eee53381 100644 --- a/lib/IR/Pass.cpp +++ b/lib/IR/Pass.cpp @@ -14,7 +14,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Pass.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/PassRegistry.h" #include "llvm/Support/Debug.h" #include "llvm/Support/PassNameParser.h" diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 492b1947bc0..6e2dd0a8e7b 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1924,11 +1924,11 @@ void CppWriter::printProgram(const std::string& fname, Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; + Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; - Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; diff --git a/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/lib/Target/NVPTX/NVPTXTargetMachine.cpp index 30de9cd5335..3c6c032833f 100644 --- a/lib/Target/NVPTX/NVPTXTargetMachine.cpp +++ b/lib/Target/NVPTX/NVPTXTargetMachine.cpp @@ -25,7 +25,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/Passes.h" #include "llvm/IR/DataLayout.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCStreamer.h" diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 70733432724..d1dd6d6a6da 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -14,9 +14,9 @@ //===----------------------------------------------------------------------===// -#include "llvm/IR/LLVMContext.h" #include "llvm/ADT/Triple.h" -#include "llvm/IR/PrintModulePass.h" +#include "llvm/IR/IRPrintingPasses.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/CodeGen/CommandFlags.h" #include "llvm/CodeGen/LinkAllAsmWriterComponents.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp index a3a99bf5126..ecea00530d9 100644 --- a/tools/llvm-extract/llvm-extract.cpp +++ b/tools/llvm-extract/llvm-extract.cpp @@ -12,12 +12,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IR/LLVMContext.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/IR/PrintModulePass.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/IRPrintingPasses.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IRReader/IRReader.h" #include "llvm/PassManager.h" diff --git a/tools/llvm-stress/llvm-stress.cpp b/tools/llvm-stress/llvm-stress.cpp index 4f98df7cce1..455b111361f 100644 --- a/tools/llvm-stress/llvm-stress.cpp +++ b/tools/llvm-stress/llvm-stress.cpp @@ -11,13 +11,13 @@ // different components in LLVM. // //===----------------------------------------------------------------------===// -#include "llvm/IR/LLVMContext.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Analysis/CallGraphSCCPass.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/IR/PrintModulePass.h" #include "llvm/IR/Constants.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/Instruction.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/Support/Debug.h" diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 5138ef68c04..44b3f13b546 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -24,9 +24,9 @@ #include "llvm/CodeGen/CommandFlags.h" #include "llvm/DebugInfo.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" -#include "llvm/IR/PrintModulePass.h" #include "llvm/IRReader/IRReader.h" #include "llvm/LinkAllIR.h" #include "llvm/LinkAllPasses.h" diff --git a/unittests/IR/LegacyPassManagerTest.cpp b/unittests/IR/LegacyPassManagerTest.cpp index 1b03305c7c3..b005c422552 100644 --- a/unittests/IR/LegacyPassManagerTest.cpp +++ b/unittests/IR/LegacyPassManagerTest.cpp @@ -27,11 +27,11 @@ #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" -#include "llvm/IR/PrintModulePass.h" #include "llvm/Pass.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h"