vaivaswatha / debugir

DebugIR: Debugging LLVM-IR Files
Apache License 2.0
125 stars 18 forks source link

LLVM 15 support #8

Open folkertdev opened 1 year ago

folkertdev commented 1 year ago

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.

vaivaswatha commented 1 year ago

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

adriaanjacobs commented 1 year ago

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.