aboutsummaryrefslogtreecommitdiff
path: root/src/cc/bpf_module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cc/bpf_module.cc')
-rw-r--r--src/cc/bpf_module.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
index ee7f7f75..91ab9af6 100644
--- a/src/cc/bpf_module.cc
+++ b/src/cc/bpf_module.cc
@@ -17,12 +17,12 @@
#include <fcntl.h>
#include <linux/bpf.h>
-#if LLVM_MAJOR_VERSION <= 16
+#if LLVM_VERSION_MAJOR <= 16
#include <llvm-c/Transforms/IPO.h>
#endif
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
-#if LLVM_MAJOR_VERSION >= 16
+#if LLVM_VERSION_MAJOR >= 16
#include <llvm/IRPrinter/IRPrintingPasses.h>
#else
#include <llvm/IR/IRPrintingPasses.h>
@@ -30,7 +30,7 @@
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Module.h>
-#if LLVM_MAJOR_VERSION >= 15
+#if LLVM_VERSION_MAJOR >= 15
#include <llvm/Pass.h>
#include <llvm/IR/PassManager.h>
#include <llvm/Passes/PassBuilder.h>
@@ -45,7 +45,7 @@
#include <llvm/Object/SymbolSize.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Transforms/IPO.h>
-#if LLVM_MAJOR_VERSION <= 16
+#if LLVM_VERSION_MAJOR <= 16
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#endif
#include <net/if.h>
@@ -122,7 +122,7 @@ class MyMemoryManager : public SectionMemoryManager {
if (!section)
continue;
-#if LLVM_MAJOR_VERSION >= 10
+#if LLVM_VERSION_MAJOR >= 10
auto sec_name = section.get()->getName();
if (!sec_name)
continue;
@@ -159,7 +159,7 @@ BPFModule::BPFModule(unsigned flags, TableStorage *ts, bool rw_engine_enabled,
LLVMInitializeBPFTargetMC();
LLVMInitializeBPFTargetInfo();
LLVMInitializeBPFAsmPrinter();
-#if LLVM_MAJOR_VERSION >= 6
+#if LLVM_VERSION_MAJOR >= 6
LLVMInitializeBPFAsmParser();
if (flags & DEBUG_SOURCE)
LLVMInitializeBPFDisassembler();
@@ -254,7 +254,7 @@ void BPFModule::annotate_light() {
}
void BPFModule::dump_ir(Module &mod) {
-#if LLVM_MAJOR_VERSION >= 15
+#if LLVM_VERSION_MAJOR >= 15
// Create the analysis managers
LoopAnalysisManager LAM;
FunctionAnalysisManager FAM;
@@ -287,7 +287,7 @@ int BPFModule::run_pass_manager(Module &mod) {
return -1;
}
-#if LLVM_MAJOR_VERSION >= 15
+#if LLVM_VERSION_MAJOR >= 15
// Create the analysis managers
LoopAnalysisManager LAM;
FunctionAnalysisManager FAM;
@@ -552,7 +552,7 @@ int BPFModule::finalize() {
*sections_p;
mod->setTargetTriple("bpf-pc-linux");
-#if LLVM_MAJOR_VERSION >= 11
+#if LLVM_VERSION_MAJOR >= 11
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
mod->setDataLayout("e-m:e-p:64:64-i64:64-i128:128-n32:64-S128");
#else
@@ -573,7 +573,7 @@ int BPFModule::finalize() {
builder.setMCJITMemoryManager(
ebpf::make_unique<MyMemoryManager>(sections_p, &*prog_func_info_));
builder.setMArch("bpf");
-#if LLVM_MAJOR_VERSION <= 11
+#if LLVM_VERSION_MAJOR <= 11
builder.setUseOrcMCJITReplacement(false);
#endif
engine_ = unique_ptr<ExecutionEngine>(builder.create());