diff --git a/ThunkLibs/Generator/analysis.cpp b/ThunkLibs/Generator/analysis.cpp index 263507f7f5..90a8d58d43 100644 --- a/ThunkLibs/Generator/analysis.cpp +++ b/ThunkLibs/Generator/analysis.cpp @@ -313,7 +313,12 @@ void AnalysisAction::ParseInterface(clang::ASTContext& context) { } // Get or add parent type to list of structure types +#if CLANG_VERSION_MAJOR >= 22 + auto parent_qt = context.getTagType(clang::ElaboratedTypeKeyword::None, std::nullopt, annotated_member->getParent(), false); + auto repack_info_it = types.emplace(context.getCanonicalType(parent_qt).getTypePtr(), RepackedType {}).first; +#else auto repack_info_it = types.emplace(context.getCanonicalType(annotated_member->getParent()->getTypeForDecl()), RepackedType {}).first; +#endif if (repack_info_it->second.assumed_compatible) { throw report_error(template_arg_loc, "May not annotate members of opaque types"); } @@ -498,7 +503,7 @@ void AnalysisAction::ParseInterface(clang::ASTContext& context) { // Convert variadic argument list into a count + pointer pair data.param_types.push_back(context.getSizeType()); data.param_types.push_back(context.getPointerType(*annotations.uniform_va_type)); - types.emplace(context.getSizeType()->getTypePtr(), RepackedType {}); + types.emplace(context.getSizeType().getTypePtr(), RepackedType {}); if (!annotations.uniform_va_type.value()->isVoidPointerType()) { types.emplace(annotations.uniform_va_type->getTypePtr(), RepackedType {}); } diff --git a/ThunkLibs/Generator/gen.cpp b/ThunkLibs/Generator/gen.cpp index 0654c9d6a6..d9db779973 100644 --- a/ThunkLibs/Generator/gen.cpp +++ b/ThunkLibs/Generator/gen.cpp @@ -3,6 +3,7 @@ #include "diagnostics.h" #include "interface.h" #include +#include #include #include @@ -816,7 +817,10 @@ bool GenerateThunkLibsActionFactory::runInvocation(std::shared_ptr= 20 +#if LLVM_VERSION_MAJOR >= 22 + auto Diags = clang::CompilerInstance::createDiagnostics(Compiler.getVirtualFileSystem(), Compiler.getDiagnosticOpts(), DiagConsumer, false); + Compiler.setDiagnostics(std::move(Diags)); +#elif LLVM_VERSION_MAJOR >= 20 Compiler.createDiagnostics(Compiler.getVirtualFileSystem(), DiagConsumer, false); #else Compiler.createDiagnostics(DiagConsumer, false); @@ -825,7 +829,11 @@ bool GenerateThunkLibsActionFactory::runInvocation(std::shared_ptr= 22 + Compiler.createSourceManager(); +#else Compiler.createSourceManager(*Files); +#endif const bool Success = Compiler.ExecuteAction(Action);