@@ -947,7 +947,12 @@ class TemporaryDeclFinder : public StmtVisitor<TemporaryDeclFinder>
947947 {},
948948 &ctx.Idents .get (mTempName ),
949949 expr->getType (),
950- ImplicitParamDecl::Other);
950+ #if IS_CLANG_NEWER_THAN(17)
951+ ImplicitParamKind::Other
952+ #else
953+ ImplicitParamDecl::Other
954+ #endif
955+ );
951956
952957#endif
953958
@@ -1385,7 +1390,7 @@ void CodeGenerator::InsertInstantiationPoint(const SourceManager& sm,
13851390{
13861391 const auto lineNo = sm.getSpellingLineNumber (instLoc);
13871392 const auto & fileId = sm.getFileID (instLoc);
1388- if (const auto * file = sm.getFileEntryForID (fileId)) {
1393+ if (const auto file = sm.getFileEntryRefForID (fileId)) {
13891394 const auto fileWithDirName = file->getName ();
13901395 const auto fileName = llvm::sys::path::filename (fileWithDirName);
13911396
@@ -2752,12 +2757,16 @@ void CodeGenerator::InsertArg(const GNUNullExpr* /*stmt*/)
27522757
27532758void CodeGenerator::InsertArg (const CharacterLiteral* stmt)
27542759{
2760+ #if IS_CLANG_NEWER_THAN(17)
2761+ #else
2762+ #define CharacterLiteralKind CharacterLiteral
2763+ #endif
27552764 switch (stmt->getKind ()) {
2756- case CharacterLiteral ::Ascii: break ;
2757- case CharacterLiteral ::Wide: mOutputFormatHelper .Append (' L' ); break ;
2758- case CharacterLiteral ::UTF8: mOutputFormatHelper .Append (" u8" sv); break ;
2759- case CharacterLiteral ::UTF16: mOutputFormatHelper .Append (' u' ); break ;
2760- case CharacterLiteral ::UTF32: mOutputFormatHelper .Append (' U' ); break ;
2765+ case CharacterLiteralKind ::Ascii: break ;
2766+ case CharacterLiteralKind ::Wide: mOutputFormatHelper .Append (' L' ); break ;
2767+ case CharacterLiteralKind ::UTF8: mOutputFormatHelper .Append (" u8" sv); break ;
2768+ case CharacterLiteralKind ::UTF16: mOutputFormatHelper .Append (' u' ); break ;
2769+ case CharacterLiteralKind ::UTF32: mOutputFormatHelper .Append (' U' ); break ;
27612770 }
27622771
27632772 switch (unsigned value = stmt->getValue ()) {
@@ -2774,7 +2783,7 @@ void CodeGenerator::InsertArg(const CharacterLiteral* stmt)
27742783 case ' \t ' : mOutputFormatHelper .Append (" '\\ t'" sv); break ;
27752784 case ' \v ' : mOutputFormatHelper .Append (" '\\ v'" sv); break ;
27762785 default :
2777- if (((value & ~0xFFu ) == ~0xFFu ) and (stmt->getKind () == CharacterLiteral ::Ascii)) {
2786+ if (((value & ~0xFFu ) == ~0xFFu ) and (stmt->getKind () == CharacterLiteralKind ::Ascii)) {
27782787 value &= 0xFFu ;
27792788 }
27802789
@@ -3563,6 +3572,11 @@ void CodeGenerator::InsertAttribute(const Attr& attr)
35633572 // skip this attribute. Clang seems to tag final methods or classes with final
35643573 RETURN_IF (attr::Final == attr.getKind ());
35653574
3575+ #if IS_CLANG_NEWER_THAN(17)
3576+ // skip this custom clang attribute
3577+ RETURN_IF (attr::NoInline == attr.getKind ());
3578+ #endif
3579+
35663580 // Clang's printPretty misses the parameter pack ellipsis. Hence treat this special case here.
35673581 if (const auto * alignedAttr = dyn_cast_or_null<AlignedAttr>(&attr)) {
35683582 auto insert = [&](const QualType type, const TemplateTypeParmType* tmplTypeParam) {
@@ -4264,7 +4278,7 @@ void CodeGenerator::InsertArg(const Decl* stmt)
42644278
42654279#include " CodeGeneratorTypes.h"
42664280
4267- TODO (stmt, mOutputFormatHelper );
4281+ ToDo (stmt, mOutputFormatHelper );
42684282}
42694283// -----------------------------------------------------------------------------
42704284
@@ -4287,7 +4301,7 @@ void CodeGenerator::InsertArg(const Stmt* stmt)
42874301
42884302#include " CodeGeneratorTypes.h"
42894303
4290- TODO (stmt, mOutputFormatHelper );
4304+ ToDo (stmt, mOutputFormatHelper );
42914305}
42924306// -----------------------------------------------------------------------------
42934307
@@ -4383,6 +4397,9 @@ void CodeGenerator::InsertTemplateArg(const TemplateArgument& arg)
43834397 mOutputFormatHelper .Append (GetName (*arg.getAsTemplateOrTemplatePattern ().getAsTemplateDecl ()));
43844398 break ;
43854399 case TemplateArgument::Null: mOutputFormatHelper .Append (" null" sv); break ;
4400+ #if IS_CLANG_NEWER_THAN(17)
4401+ case TemplateArgument::StructuralValue: ToDo (arg, mOutputFormatHelper ); break ;
4402+ #endif
43864403 }
43874404}
43884405// -----------------------------------------------------------------------------
@@ -4411,7 +4428,11 @@ void CodeGenerator::HandleLocalStaticNonTrivialClass(const VarDecl* stmt)
44114428 ctx.getConstantArrayType (ctx.CharTy ,
44124429 llvm::APInt (ctx.getTypeSize (ctx.getSizeType ()), 0 ),
44134430 Sizeof (stmt->getType ()),
4414- ArrayType::ArraySizeModifier::Normal,
4431+ #if IS_CLANG_NEWER_THAN(17)
4432+ #else
4433+ ArrayType::
4434+ #endif
4435+ ArraySizeModifier::Normal,
44154436 0 ));
44164437
44174438 compilerStorageVar->setStorageClass (StorageClass::SC_Static);
@@ -4815,7 +4836,11 @@ void CodeGenerator::InsertFunctionNameWithReturnType(const FunctionDecl& d
48154836 // template requires-clause during creation of the template head.
48164837 InsertConceptConstraint (&decl);
48174838
4839+ #if IS_CLANG_NEWER_THAN(17)
4840+ if (decl.isPureVirtual ()) {
4841+ #else
48184842 if (decl.isPure ()) {
4843+ #endif
48194844 mOutputFormatHelper .Append (" = 0" sv);
48204845 }
48214846}
0 commit comments