Skip to content

Commit daf35cd

Browse files
committed
Fix a llvm compilation error
With latest llvm16, I got the following compilation error: /.../src/cc/bpf_module.cc: In member function ‘void ebpf::BPFModule::dump_ir(llvm::Module&)’: /.../src/cc/bpf_module.cc:259:15: error: ‘PrintModulePass’ was not declared in this scope MPM.addPass(PrintModulePass(errs())); ^~~~~~~~~~~~~~~ ... The error is due to the llvm patch https://reviews.llvm.org/D138081. Fix the issue by adjust corresponding header file locaiton as in the above llvm patch. Signed-off-by: Yonghong Song <[email protected]>
1 parent 957569f commit daf35cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cc/bpf_module.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
#include <llvm-c/Transforms/IPO.h>
2121
#include <llvm/ExecutionEngine/MCJIT.h>
2222
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
23+
#if LLVM_MAJOR_VERSION >= 16
24+
#include <llvm/IRPrinter/IRPrintingPasses.h>
25+
#else
2326
#include <llvm/IR/IRPrintingPasses.h>
27+
#endif
2428
#include <llvm/IR/LLVMContext.h>
2529
#include <llvm/IR/Module.h>
2630

0 commit comments

Comments
 (0)