Skip to content
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

Thunks/gen: Add support for compiling against clang 19 #4193

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

WhatAmISupposedToPutHere
Copy link
Contributor

No description provided.

Copy link
Collaborator

@alyssarosenzweig alyssarosenzweig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice cleanup :)

@neobrain
Copy link
Member

neobrain commented Dec 5, 2024

Unit tests (BUILD_TESTS=ON) will still fail to compile with LLVM 19:

diff --git unittests/ThunkLibs/generator.cpp unittests/ThunkLibs/generator.cpp
index d3fc9c7c0..38eadbfd6 100644
--- unittests/ThunkLibs/generator.cpp
+++ unittests/ThunkLibs/generator.cpp
@@ -417,7 +417,7 @@ TEST_CASE_METHOD(Fixture, "VersionedLibrary") {

   CHECK_THAT(output, matches(callExpr(callee(functionDecl(hasName("dlopen"))), hasArgument(0, stringLiteral().bind("libname"))))
                        .check_binding(
-                         "libname", +[](const clang::StringLiteral* lit) { return lit->getString().endswith(".so.123"); }));
+                         "libname", +[](const clang::StringLiteral* lit) { return lit->getString().ends_with(".so.123"); }));
 }

 TEST_CASE_METHOD(Fixture, "FunctionPointerViaType") {

Other than that, tested and confirmed to produce working error messages equivalent to older LLVM versions. Well done!

@neobrain
Copy link
Member

neobrain commented Dec 5, 2024

Apparently the CI runners still use LLVM 14 🙃
So we'll also need an #ifdef there. The new API name was introduced with LLVM 17.

EDIT: I answered too late, you already fixed it

Copy link
Member

@neobrain neobrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks again!

@neobrain neobrain merged commit 7b2fc37 into FEX-Emu:main Dec 5, 2024
12 checks passed
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.

4 participants