diff options
Diffstat (limited to 'tools/opt/Passes.cpp')
-rw-r--r-- | tools/opt/Passes.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/opt/Passes.cpp b/tools/opt/Passes.cpp index 36fe6ad126..ca143042f6 100644 --- a/tools/opt/Passes.cpp +++ b/tools/opt/Passes.cpp @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "Passes.h" +#include "llvm/Analysis/LazyCallGraph.h" #include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/PassManager.h" #include "llvm/IR/Verifier.h" @@ -43,6 +44,7 @@ struct NoOpFunctionPass { static bool isModulePassName(StringRef Name) { if (Name == "no-op-module") return true; if (Name == "print") return true; + if (Name == "print-cg") return true; return false; } @@ -63,6 +65,10 @@ static bool parseModulePassName(ModulePassManager &MPM, StringRef Name) { MPM.addPass(PrintModulePass(dbgs())); return true; } + if (Name == "print-cg") { + MPM.addPass(LazyCallGraphPrinterPass(dbgs())); + return true; + } return false; } |