blob: 2ae1ad5d8383cf06d1e22e4d4066b7dc5a039263 [file] [log] [blame]
Chandler Carruth66445382014-01-11 08:16:35 +00001//===- NewPMDriver.h - Function to drive opt with the new PM ----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9/// \file
10///
11/// A single function which is called to drive the opt behavior for the new
12/// PassManager.
13///
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
17/// opt.cpp.
18///
19//===----------------------------------------------------------------------===//
20
21#ifndef LLVM_TOOLS_OPT_NEW_PM_DRIVER_H
22#define LLVM_TOOLS_OPT_NEW_PM_DRIVER_H
23
24#include "llvm/ADT/StringRef.h"
25
26namespace llvm {
27class LLVMContext;
28class Module;
29class tool_output_file;
30
Chandler Carruth949282e2014-01-13 03:08:40 +000031namespace opt_tool {
32enum OutputKind {
33 OK_NoOutput,
34 OK_OutputAssembly,
35 OK_OutputBitcode
36};
37}
38
Chandler Carruth66445382014-01-11 08:16:35 +000039/// \brief Driver function to run the new pass manager over a module.
40///
41/// This function only exists factored away from opt.cpp in order to prevent
42/// inclusion of the new pass manager headers and the old headers into the same
43/// file. It's interface is consequentially somewhat ad-hoc, but will go away
44/// when the transition finishes.
45bool runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
46 tool_output_file *Out, StringRef PassPipeline,
Chandler Carruth949282e2014-01-13 03:08:40 +000047 opt_tool::OutputKind OK);
Chandler Carruth66445382014-01-11 08:16:35 +000048}
49
50#endif