Skip to content

Support for building with LLVM 19 #1099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

vengaer
Copy link
Contributor

@vengaer vengaer commented May 2, 2025

I ran into some trouble when wanting to use Mull with LLVM 19. Can't claim there is too much interesting in it the incompatibilities - mostly a few functions that have been either renamed or removed, and a few headers that now need to be included explicitly.

I won't claim that there changes include everything required for full LLVM 19 compatibility. I have, for example, made no effort to update the CI so this is definitely not on par with the work done when adding LLVM 18 support. Still, it ought to at least be a decent start. If you're interested in it, you're more than welcome to use it.

vengaer added 6 commits May 3, 2025 00:05
Something would appear to have changed among clang's header inclusions
between versions 18 and 19. I haven't dug too far into it but in at
least clang 19.1.7, llvm::Module is incomplete when used in
MutationPoint.cpp.

Include the Module.h header to ensure the class is available.
llvm::StringRef's endswith has been deprecated since llvm commit
1b97645e56bf321b, part of llvm 17 and was removed in llvm 20. Users
are now expected to use the ends_with function instead. Abide by this.

Seeing as mull appears to still support several llvm versions predating
17, care is taken to use the older naming convention in these.
6c1dbd5359c4336d, part of llvm 20, removed the getName function in
llvm::FileEntry. Use the namesake in llvm::FileEntryRef instead.

N.B. I'm not entirely sure this does the right thing. I'd assume it
does, especially judging by the pre-llvm18 code. If I'm mistaken, please
let me know.
Seems StringRef::equals was temporarily removed in llvm 19. While it's
back in 20, tags such as 19.1.7 does not include it.

Use the equality operator instead. This appears to have been there
forever and it seems unlikely it'd ever be removed
Mull doesn't compile with llvm 20 due to llvm_shutdown_obj not being
being available. Include the required header.
@AlexDenisov
Copy link
Member

Thank you for the initiative @vengaer, I'll try to get to it soon-ish 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants