debugir icon indicating copy to clipboard operation
debugir copied to clipboard

LLVM 15 support

Open folkertdev opened this issue 2 years ago • 2 comments

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.

folkertdev avatar Jan 16 '23 21:01 folkertdev

I haven't had the time to do this, but any PRs for this is welcome !

vaivaswatha avatar Mar 03 '23 07:03 vaivaswatha

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.

adriaanjacobs avatar Jul 25 '23 12:07 adriaanjacobs