1 //===- NewPMDriver.h - Function to drive opt with the new PM ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// A single function which is called to drive the opt behavior for the new
14 /// This is only in a separate TU with a header to avoid including all of the
15 /// old pass manager headers and the new pass manager headers into the same
16 /// file. Eventually all of the routines here will get folded back into
19 //===----------------------------------------------------------------------===//
21 #ifndef LLVM_TOOLS_OPT_NEWPMDRIVER_H
22 #define LLVM_TOOLS_OPT_NEWPMDRIVER_H
29 class tool_output_file
;
36 OK_OutputThinLTOBitcode
,
45 /// \brief Driver function to run the new pass manager over a module.
47 /// This function only exists factored away from opt.cpp in order to prevent
48 /// inclusion of the new pass manager headers and the old headers into the same
49 /// file. It's interface is consequentially somewhat ad-hoc, but will go away
50 /// when the transition finishes.
52 /// ThinLTOLinkOut is only used when OK is OK_OutputThinLTOBitcode, and can be
54 bool runPassPipeline(StringRef Arg0
, Module
&M
, TargetMachine
*TM
,
55 tool_output_file
*Out
, tool_output_file
*ThinLinkOut
,
56 tool_output_file
*OptRemarkFile
, StringRef PassPipeline
,
57 opt_tool::OutputKind OK
, opt_tool::VerifierKind VK
,
58 bool ShouldPreserveAssemblyUseListOrder
,
59 bool ShouldPreserveBitcodeUseListOrder
,
60 bool EmitSummaryIndex
, bool EmitModuleHash
);