[wip] Add support for llvm 22#773
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #773 +/- ##
=======================================
Coverage 79.07% 79.07%
=======================================
Files 9 9
Lines 3899 3899
=======================================
Hits 3083 3083
Misses 816 816
🚀 New features to boost your workflow:
|
|
@vgvassilev do we plan to drop the clang20 out-of-process patch like this issue suggests #742, when migrating to llvm 22, or keep it for those who want to use llvm 20? I have ported the patch locally for llvm 21, so can put in a PR quickly with the patch for llvm 21, if people are worried about having a feature for llvm 20 and 22, but not 21. The ci in CppInterOp would not support these patched llvms. |
|
Tasks needed for llvm upgrade
|
Removed unused SuppressElaboration and SuppressScope macros.
| TKCASE(MemberPointer); | ||
| TKCASE(Auto); | ||
| TKCASE(Auto); | ||
| #if CLANG_VERSION_MAJOR < 22 |
There was a problem hiding this comment.
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>| #include "clang/Config/config.h" | ||
| #include "clang/Sema/Sema.h" | ||
| #include <iostream> | ||
|
|
There was a problem hiding this comment.
warning: included header iostream is not used directly [misc-include-cleaner]
|
@anutosh491 @Vipul-Cariappa Since you'll probably know how to update CppInterOps oop related code to be compatible with llvm 22, I was wondering you could look at these build errors. I had a very quick go at fixing them last night without success. See https://github.com/compiler-research/CppInterOp/actions/runs/21064882331/job/60579731760#step:12:181 for the errors |
c404772 to
ea2db56
Compare
| ASTContext& C = FD->getASTContext(); | ||
| PrintingPolicy Policy(C.getPrintingPolicy()); | ||
| Policy.SuppressElaboration = true; | ||
| Policy.Suppress_Elab = true; |
There was a problem hiding this comment.
warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
| Policy.Suppress_Elab = true; | |
| if (const auto* Typedef = dyn_cast<const TypedefDecl>(TD)) { |
| // FIXME: Remove the need of exposing the low-level execution engine and kill | ||
| // this horrible hack. |
There was a problem hiding this comment.
@vgvassilev does this fixme still apply?
The solution provided by you which had this fixme I had to remove as I determined it ws causing the segmentation fault which stopped the tests running, This solution comes from janks repo, and allows the tests to run
There was a problem hiding this comment.
The fixme is still valid.
|
If only cppyy fails as it fails in master, then can you squash all into one commit and apply clang-format. This should be ready to go. |
This reverts commit 894b817.
| #if CLANG_VERSION_MAJOR < 22 | ||
| #define Suppress_Elab SuppressElaboration | ||
| #else | ||
| #define Suppress_Elab FullyQualifiedName |
There was a problem hiding this comment.
I'm not sure what this is supposed to be. This is what I last tried, but have tried a few things in past commits. Jank effectively has removed all references to SuppressElaboration in their fork of CppInterOp.
Description
Please include a summary of changes, motivation and context for this PR.
Now that the release/22.x branch has been created, this PR will get CppInterOp ready for the llvm 22 release. It will concentrate on the native case for now, while the issue with wasm exceptions and llvm 21 is resolved.
Fixes # (issue)
Type of change
Please tick all options which are relevant.
Testing
Please describe the test(s) that you added and ran to verify your changes.
Checklist