|
| 1 | +#ifndef INCLUDED_RUSTC_LLVM_LLVMWRAPPER_H |
| 2 | +#define INCLUDED_RUSTC_LLVM_LLVMWRAPPER_H |
| 3 | + |
1 | 4 | #include "SuppressLLVMWarnings.h" |
2 | 5 |
|
3 | | -#include "llvm-c/BitReader.h" |
4 | | -#include "llvm-c/Core.h" |
5 | | -#include "llvm-c/Object.h" |
6 | | -#include "llvm/ADT/ArrayRef.h" |
7 | | -#include "llvm/ADT/DenseSet.h" |
8 | | -#include "llvm/ADT/SmallVector.h" |
9 | | -#include "llvm/Analysis/Lint.h" |
10 | | -#include "llvm/Analysis/Passes.h" |
11 | | -#include "llvm/IR/IRBuilder.h" |
12 | | -#include "llvm/IR/InlineAsm.h" |
13 | | -#include "llvm/IR/LLVMContext.h" |
14 | | -#include "llvm/IR/Module.h" |
15 | | -#include "llvm/Support/CommandLine.h" |
16 | | -#include "llvm/Support/Debug.h" |
17 | | -#include "llvm/Support/DynamicLibrary.h" |
18 | | -#include "llvm/Support/FormattedStream.h" |
19 | | -#include "llvm/Support/JSON.h" |
20 | | -#include "llvm/Support/Memory.h" |
21 | | -#include "llvm/Support/SourceMgr.h" |
22 | | -#include "llvm/Support/TargetSelect.h" |
23 | | -#include "llvm/Support/Timer.h" |
24 | | -#include "llvm/Support/raw_ostream.h" |
25 | | -#include "llvm/Target/TargetMachine.h" |
26 | | -#include "llvm/Target/TargetOptions.h" |
27 | | -#include "llvm/Transforms/IPO.h" |
28 | | -#include "llvm/Transforms/Scalar.h" |
| 6 | +#include "llvm/Config/llvm-config.h" // LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR |
| 7 | +#include "llvm/Support/raw_ostream.h" // llvm::raw_ostream |
| 8 | +#include <cstddef> // size_t etc |
| 9 | +#include <cstdint> // uint64_t etc |
29 | 10 |
|
30 | 11 | #define LLVM_VERSION_GE(major, minor) \ |
31 | 12 | (LLVM_VERSION_MAJOR > (major) || \ |
32 | 13 | LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR >= (minor)) |
33 | 14 |
|
34 | 15 | #define LLVM_VERSION_LT(major, minor) (!LLVM_VERSION_GE((major), (minor))) |
35 | 16 |
|
36 | | -#if LLVM_VERSION_GE(20, 0) |
37 | | -#include "llvm/Transforms/Utils/Instrumentation.h" |
38 | | -#else |
39 | | -#include "llvm/Transforms/Instrumentation.h" |
40 | | -#endif |
41 | | - |
42 | | -#include "llvm/IR/LegacyPassManager.h" |
43 | | - |
44 | | -#include "llvm/Bitcode/BitcodeReader.h" |
45 | | -#include "llvm/Bitcode/BitcodeWriter.h" |
46 | | - |
47 | | -#include "llvm/IR/DIBuilder.h" |
48 | | -#include "llvm/IR/DebugInfo.h" |
49 | | -#include "llvm/IR/IRPrintingPasses.h" |
50 | | -#include "llvm/Linker/Linker.h" |
51 | | - |
52 | | -#include "llvm/TargetParser/Triple.h" |
53 | | - |
54 | 17 | extern "C" void LLVMRustSetLastError(const char *); |
55 | 18 |
|
56 | 19 | enum class LLVMRustResult { Success, Failure }; |
@@ -81,3 +44,5 @@ class RawRustStringOstream : public llvm::raw_ostream { |
81 | 44 | flush(); |
82 | 45 | } |
83 | 46 | }; |
| 47 | + |
| 48 | +#endif // INCLUDED_RUSTC_LLVM_LLVMWRAPPER_H |
0 commit comments