[PM] Add an enum for describing the desired output strategy, and run
[oota-llvm.git] / tools / opt / NewPMDriver.cpp
index e577995e26030d8e549eb8a3f3fae1384f863cc1..b05da36d28121b5adb61c2c68e58f067f8bb8a3e 100644 (file)
 #include "llvm/Support/ToolOutputFile.h"
 
 using namespace llvm;
+using namespace opt_tool;
 
 bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
                            tool_output_file *Out, StringRef PassPipeline,
-                           bool NoOutput) {
+                           OutputKind OK) {
   // Before executing passes, print the final values of the LLVM options.
   cl::PrintOptionValues();
 
@@ -40,7 +41,7 @@ bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
   MPM.run(&M);
 
   // Declare success.
-  if (!NoOutput)
+  if (OK != OK_NoOutput)
     Out->keep();
   return true;
 }