[PATCH] D148243: BPF: Fix skipping of types in map-in-map inner map def

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 17:37:59 PDT 2023


yonghong-song added a comment.

Overall looks good. Just a few minor comments above.



================
Comment at: llvm/lib/Target/BPF/BTFDebug.cpp:954
+  auto *ValuesTy = dyn_cast<DICompositeType>(DTy->getBaseType());
+  if (!ValuesTy)
+    return false;
----------------
Let us also check ValuesTy is an array type?


================
Comment at: llvm/lib/Target/BPF/BTFDebug.cpp:958
+  auto *InnerMapDerivedTy = dyn_cast<DIDerivedType>(ValuesTy->getBaseType());
+  if (!InnerMapDerivedTy)
+    return false;
----------------
Let us also check InnerMapDerivedTy to be a pointer type?


================
Comment at: llvm/test/CodeGen/BPF/BTF/inner-map-def.ll:21
+;     });
+;   } array_of_hash_maps __attribute__((section(".maps")));
+;  Compilation Flags:
----------------
Since we added the source code here, we should make the code compilable with compilation flags below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148243/new/

https://reviews.llvm.org/D148243



More information about the llvm-commits mailing list