3 ms·
FWIW I think Clang IR does something like this in a lot of places. It is relatively common to see child nodes stored inline following parent nodes. The APIs m
by loeg 11mo ago
FWIW I think Clang IR does something like this in a lot of places. It is relatively common to see child nodes stored inline following parent nodes. The APIs more or less abstract this away from consumers like static analysis tools, though.
E.g., https://github.com/llvm/llvm-project/blob/62e00a03fba029f82d421fb3c814a6a02d59b8c8/clang/include/clang/AST/Expr.h#L2887-L2927 https://github.com/llvm/llvm-project/blob/62e00a03fba029f82d...
and
https://github.com/llvm/llvm-project/blob/62e00a03fba029f82d421fb3c814a6a02d59b8c8/llvm/include/llvm/Support/TrailingObjects.h#L10-L21 https://github.com/llvm/llvm-project/blob/62e00a03fba029f82d...