@@ -967,12 +967,7 @@ class TemporaryDeclFinder : public StmtVisitor<TemporaryDeclFinder>
967967 {},
968968 &ctx.Idents .get (mTempName ),
969969 expr->getType (),
970- #if IS_CLANG_NEWER_THAN(17)
971- ImplicitParamKind::Other
972- #else
973- ImplicitParamDecl::Other
974- #endif
975- );
970+ ImplicitParamKind::Other);
976971
977972#endif
978973
@@ -1208,17 +1203,7 @@ static bool IsPrimaryTemplatePackExpansionExpr(const ParenListExpr* stmt)
12081203
12091204void CodeGenerator::InsertArg (const LinkageSpecDecl* stmt)
12101205{
1211- mOutputFormatHelper .Append (" extern \" " ,
1212- (
1213- #if IS_CLANG_NEWER_THAN(17)
1214- LinkageSpecLanguageIDs::C
1215- #else
1216- LinkageSpecDecl::lang_c
1217- #endif
1218- == stmt->getLanguage ())
1219- ? " C" sv
1220- : " C++" sv,
1221- " \" " );
1206+ mOutputFormatHelper .Append (" extern \" " , (LinkageSpecLanguageIDs::C == stmt->getLanguage ()) ? " C" sv : " C++" sv, " \" " );
12221207 mOutputFormatHelper .OpenScope ();
12231208
12241209 for (const auto * decl : stmt->decls ()) {
@@ -1752,26 +1737,14 @@ void CodeGenerator::InsertTemplateParameters(const TemplateParameterList& list,
17521737 if (tt->hasDefaultArgument () and not tt->defaultArgumentWasInherited ()) {
17531738 const auto & defaultArg = tt->getDefaultArgument ();
17541739
1755- if (const auto decltypeType = dyn_cast_or_null<DecltypeType>(defaultArg
1756- .
1757- #if IS_CLANG_NEWER_THAN(18)
1758- getArgument ()
1759- .getAsType ()
1760- #else
1761- getTypePtrOrNull ()
1762- #endif
1763- )) {
1740+ if (const auto decltypeType = dyn_cast_or_null<DecltypeType>(defaultArg.getArgument ().getAsType ())) {
17641741 mOutputFormatHelper .Append (hlpAssing);
17651742
17661743 InsertArg (decltypeType->getUnderlyingExpr ());
17671744
17681745 } else {
17691746 mOutputFormatHelper .Append (hlpAssing);
1770- InsertTemplateArg (defaultArg
1771- #if IS_CLANG_NEWER_THAN(18)
1772- .getArgument ()
1773- #endif
1774- );
1747+ InsertTemplateArg (defaultArg.getArgument ());
17751748 }
17761749 }
17771750
@@ -1788,11 +1761,7 @@ void CodeGenerator::InsertTemplateParameters(const TemplateParameterList& list,
17881761
17891762 if (nonTmplParam->hasDefaultArgument ()) {
17901763 mOutputFormatHelper .Append (hlpAssing);
1791- #if IS_CLANG_NEWER_THAN(18)
17921764 InsertTemplateArg (nonTmplParam->getDefaultArgument ().getArgument ());
1793- #else
1794- InsertArg (nonTmplParam->getDefaultArgument ());
1795- #endif
17961765 }
17971766 } else {
17981767 mOutputFormatHelper .Append (typeName, EllipsisSpace (nonTmplParam->isParameterPack ()));
@@ -3048,7 +3017,6 @@ void CodeGenerator::InsertArg(const TypeAliasDecl* stmt)
30483017 mOutputFormatHelper .Append (kwUsingSpace, GetName (*stmt), hlpAssing);
30493018
30503019 if (auto * templateSpecializationType = underlyingType->getAs <TemplateSpecializationType>()) {
3051- #if IS_CLANG_NEWER_THAN(18)
30523020 const bool carriesNamespace{[&] {
30533021 if (const auto tn = templateSpecializationType->getTemplateName ();
30543022 (TemplateName::QualifiedTemplate == tn.getKind ()) or (TemplateName::DependentTemplate == tn.getKind ())) {
@@ -3066,11 +3034,6 @@ void CodeGenerator::InsertArg(const TypeAliasDecl* stmt)
30663034 InsertNamespace (elaboratedType->getQualifier ());
30673035 }
30683036 }
3069- #else
3070- if (const auto * elaboratedType = underlyingType->getAs <ElaboratedType>()) {
3071- InsertNamespace (elaboratedType->getQualifier ());
3072- }
3073- #endif
30743037
30753038 StringStream stream{};
30763039 stream.Print (*templateSpecializationType);
@@ -3699,10 +3662,8 @@ void CodeGenerator::InsertAttribute(const Attr& attr)
36993662 // skip this attribute. Clang seems to tag final methods or classes with final
37003663 RETURN_IF (attr::Final == attr.getKind ());
37013664
3702- #if IS_CLANG_NEWER_THAN(17)
37033665 // skip this custom clang attribute
37043666 RETURN_IF (attr::NoInline == attr.getKind ());
3705- #endif
37063667
37073668 // Clang's printPretty misses the parameter pack ellipsis. Hence treat this special case here.
37083669 if (const auto * alignedAttr = dyn_cast_or_null<AlignedAttr>(&attr)) {
@@ -3740,12 +3701,6 @@ void CodeGenerator::InsertAttribute(const Attr& attr)
37403701
37413702 // attributes start with a space, skip it as it is not required for the first attribute
37423703 std::string_view start{stream.str ()};
3743- #if IS_CLANG_NEWER_THAN(18)
3744- #else
3745- if (!start.empty ()) {
3746- start.remove_prefix (1 );
3747- }
3748- #endif
37493704
37503705 mOutputFormatHelper .Append (start, " " sv);
37513706}
@@ -4485,20 +4440,11 @@ void CodeGenerator::InsertSuffix(const QualType& type)
44854440
44864441void CodeGenerator::InsertTemplateArgs (const ClassTemplateSpecializationDecl& clsTemplateSpe)
44874442{
4488- #if IS_CLANG_NEWER_THAN(18)
44894443 if (const auto * ar = clsTemplateSpe.getTemplateArgsAsWritten ()) {
44904444 InsertTemplateArgs (ar->arguments ());
44914445 } else {
44924446 InsertTemplateArgs (clsTemplateSpe.getTemplateArgs ());
44934447 }
4494- #else
4495- if (const TypeSourceInfo* typeAsWritten = clsTemplateSpe.getTypeAsWritten ()) {
4496- const TemplateSpecializationType* tmplSpecType = cast<TemplateSpecializationType>(typeAsWritten->getType ());
4497- InsertTemplateArgs (*tmplSpecType);
4498- } else {
4499- InsertTemplateArgs (clsTemplateSpe.getTemplateArgs ());
4500- }
4501- #endif
45024448}
45034449// -----------------------------------------------------------------------------
45044450
@@ -4536,9 +4482,7 @@ void CodeGenerator::InsertTemplateArg(const TemplateArgument& arg)
45364482 mOutputFormatHelper .Append (GetName (*arg.getAsTemplateOrTemplatePattern ().getAsTemplateDecl ()));
45374483 break ;
45384484 case TemplateArgument::Null: mOutputFormatHelper .Append (" null" sv); break ;
4539- #if IS_CLANG_NEWER_THAN(17)
45404485 case TemplateArgument::StructuralValue: ToDo (arg, mOutputFormatHelper ); break ;
4541- #endif
45424486 }
45434487}
45444488// -----------------------------------------------------------------------------
@@ -4567,10 +4511,6 @@ void CodeGenerator::HandleLocalStaticNonTrivialClass(const VarDecl* stmt)
45674511 ctx.getConstantArrayType (ctx.CharTy ,
45684512 llvm::APInt (ctx.getTypeSize (ctx.getSizeType ()), 0 ),
45694513 Sizeof (stmt->getType ()),
4570- #if IS_CLANG_NEWER_THAN(17)
4571- #else
4572- ArrayType::
4573- #endif
45744514 ArraySizeModifier::Normal,
45754515 0 ));
45764516
@@ -4979,11 +4919,7 @@ void CodeGenerator::InsertFunctionNameWithReturnType(const FunctionDecl& d
49794919 // template requires-clause during creation of the template head.
49804920 InsertConceptConstraint (&decl);
49814921
4982- #if IS_CLANG_NEWER_THAN(17)
49834922 if (decl.isPureVirtual ()) {
4984- #else
4985- if (decl.isPure ()) {
4986- #endif
49874923 mOutputFormatHelper .Append (" = 0" sv);
49884924 }
49894925
0 commit comments