Skip to content

[wip] Add llvm 22 support#812

Draft
mcbarton wants to merge 9 commits intocompiler-research:mainfrom
mcbarton:llvm-22
Draft

[wip] Add llvm 22 support#812
mcbarton wants to merge 9 commits intocompiler-research:mainfrom
mcbarton:llvm-22

Conversation

@mcbarton
Copy link
Collaborator

#773 was previously trying to do too much at once, so this PR limits itself to just changes relating to updating CppInterOp to be compatible with llvm 22. This PR will also not update the oop jobs which will be left to someone else to do.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.56%. Comparing base (795f450) to head (5eb615f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #812   +/-   ##
=======================================
  Coverage   79.56%   79.56%           
=======================================
  Files          11       11           
  Lines        4013     4013           
=======================================
  Hits         3193     3193           
  Misses        820      820           
Files with missing lines Coverage Δ
lib/CppInterOp/CXCppInterOp.cpp 49.56% <ø> (ø)
lib/CppInterOp/Compatibility.h 86.95% <100.00%> (ø)
lib/CppInterOp/CppInterOp.cpp 87.86% <100.00%> (ø)
Files with missing lines Coverage Δ
lib/CppInterOp/CXCppInterOp.cpp 49.56% <ø> (ø)
lib/CppInterOp/Compatibility.h 86.95% <100.00%> (ø)
lib/CppInterOp/CppInterOp.cpp 87.86% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

TKCASE(ExtVector);
TKCASE(MemberPointer);
TKCASE(Auto);
#if CLANG_VERSION_MAJOR < 22
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "CLANG_VERSION_MAJOR" is directly included [misc-include-cleaner]

lib/CppInterOp/CXCppInterOp.cpp:16:

- #include <cstring>
+ #include <clang/Basic/Version.h>
+ #include <cstring>

@mcbarton
Copy link
Collaborator Author

Failing tests Emscripten build

1: [  FAILED  ] 6 tests, listed below:
1: [  FAILED  ] CppInterOpTest/InProcessJIT.FunctionReflection_JitCallAdvanced, where TypeParam = InProcessJITConfig
1: [  FAILED  ] CppInterOpTest/InProcessJIT.FunctionReflection_Construct, where TypeParam = InProcessJITConfig
1: [  FAILED  ] CppInterOpTest/InProcessJIT.FunctionReflection_ConstructPOD, where TypeParam = InProcessJITConfig
1: [  FAILED  ] CppInterOpTest/InProcessJIT.FunctionReflection_ConstructNested, where TypeParam = InProcessJITConfig
1: [  FAILED  ] CppInterOpTest/InProcessJIT.Interpreter_EmscriptenExceptionHandling, where TypeParam = InProcessJITConfig
1: [  FAILED  ] CppInterOpTest/InProcessJIT.ScopeReflection_GetCompleteName, where TypeParam = InProcessJITConfig

Following test crashes googletest for native build

2: [ RUN      ] CppInterOpDispatchTest/InProcessJIT.FunctionReflection_JitCallAdvanced
2: CppInterOpTestsDispatch: /home/runner/work/CppInterOp/CppInterOp/llvm-project/clang/include/clang/AST/Decl.h:3539: const clang::Type* clang::TypeDecl::getTypeForDecl() const: Assertion `!isa<TagDecl>(this)' failed.

Given this test fails for Emscripten case, it feels likely that all tests which fail for the Emscripten case also fail for the native case.

@mcbarton
Copy link
Collaborator Author

mcbarton commented Mar 12, 2026

@aaronj0 I tried your suggestion here #836 (comment) locally for getExecutionEngine, and llvm 22 still fails in the same way this PR does with janks solution (for example getting 2: Assertion failed: (!isa<TagDecl>(this)), function getTypeForDecl, file Decl.h, line 3539. for CppInterOpDispatchTest/InProcessJIT.FunctionReflection_JitCallAdvanced. Does your solution have any advantage of janks solution, or they effectively identical in the approach to the problem?

fyi I haven't had time yet to determine if the Assertion failed: (!isa<TagDecl>(this)), function getTypeForDecl, file Decl.h, line 3539. error is caused by something in this PR, or in llvm 22.

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.

1 participant