xref: /freebsd/contrib/llvm-project/llvm/tools/llc/NewPMDriver.h (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1 //===- NewPMDriver.h - Function to drive llc with the new PM ----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 ///
10 /// A single function which is called to drive the llc behavior for the new
11 /// PassManager.
12 ///
13 /// This is only in a separate TU with a header to avoid including all of the
14 /// old pass manager headers and the new pass manager headers into the same
15 /// file. Eventually all of the routines here will get folded back into
16 /// llc.cpp.
17 ///
18 //===----------------------------------------------------------------------===//
19 #ifndef LLVM_TOOLS_LLC_NEWPMDRIVER_H
20 #define LLVM_TOOLS_LLC_NEWPMDRIVER_H
21 
22 #include "llvm/IR/DiagnosticHandler.h"
23 #include "llvm/Support/CodeGen.h"
24 #include <memory>
25 #include <vector>
26 
27 namespace llvm {
28 class Module;
29 class TargetLibraryInfoImpl;
30 class TargetMachine;
31 class ToolOutputFile;
32 class LLVMContext;
33 class MIRParser;
34 
35 struct LLCDiagnosticHandler : public DiagnosticHandler {
36   bool handleDiagnostics(const DiagnosticInfo &DI) override;
37 };
38 
39 int compileModuleWithNewPM(StringRef Arg0, std::unique_ptr<Module> M,
40                            std::unique_ptr<MIRParser> MIR,
41                            std::unique_ptr<TargetMachine> Target,
42                            std::unique_ptr<ToolOutputFile> Out,
43                            std::unique_ptr<ToolOutputFile> DwoOut,
44                            LLVMContext &Context,
45                            const TargetLibraryInfoImpl &TLII, bool NoVerify,
46                            StringRef PassPipeline, CodeGenFileType FileType);
47 } // namespace llvm
48 
49 #endif
50