debugir
debugir copied to clipboard
LLVM 15 support
the code mostly works with llvm 15, except one occurence of getPointerElementType
} else if (T->isPointerTy()) {
Type *PointeeTy = T->getPointerElementType();
if (!(N = getType(PointeeTy)))
N = Builder.createPointerType(
getOrCreateType(PointeeTy), Layout.getPointerTypeSizeInBits(T),
Layout.getPrefTypeAlignment(T), /*DWARFAddressSpace=*/None,
getTypeName(T));
llvm 15 makes opaque pointers the default, and those don't have getPointerElementType
any more. With this piece of code commented the build succeeds, but I'm not sure what consequences that has for the tool actually functioning.
I haven't had the time to do this, but any PRs for this is welcome !
LLVM 15 still fully supports typed pointers (ref), and using the deprecated interface is only a warning, so adding
add_compile_options(-Wno-deprecated-declarations)
to the CMakeLists.txt worked perfectly fine for me
ref: https://llvm.org/docs/OpaquePointers.html#:~:text=LLVM%2015%3A%20Opaque%20pointers%20are%20enabled%20by%20default.%20Typed%20pointers%20are%20still%20supported.