aboutsummaryrefslogtreecommitdiff
path: root/src/cc/bpf_module_rw_engine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cc/bpf_module_rw_engine.cc')
-rw-r--r--src/cc/bpf_module_rw_engine.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cc/bpf_module_rw_engine.cc b/src/cc/bpf_module_rw_engine.cc
index 533d8a13..f1649880 100644
--- a/src/cc/bpf_module_rw_engine.cc
+++ b/src/cc/bpf_module_rw_engine.cc
@@ -401,7 +401,12 @@ int BPFModule::annotate() {
GlobalValue *gvar = mod_->getNamedValue(table.name);
if (!gvar) continue;
if (PointerType *pt = dyn_cast<PointerType>(gvar->getType())) {
- if (StructType *st = dyn_cast<StructType>(pt->getElementType())) {
+#if LLVM_MAJOR_VERSION >= 15
+ StructType *st = dyn_cast<StructType>(pt->getPointerElementType());
+#else
+ StructType *st = dyn_cast<StructType>(pt->getElementType());
+#endif
+ if (st) {
if (st->getNumElements() < 2) continue;
Type *key_type = st->elements()[0];
Type *leaf_type = st->elements()[1];