@@ -16,17 +16,17 @@ let cppNamespace = "::mlir::cir" in {
1616 let methods = [
1717 InterfaceMethod<" " , " bool" , " hasOwnerAttr" , (ins), [{}],
1818 /* defaultImplementation=*/ [{
19- return $_attr.getAstDecl ()->template hasAttr < clang::OwnerAttr >();
19+ return $_attr.getAstDecl ()->template hasAttr <clang::OwnerAttr>();
2020 }]
2121 >,
2222 InterfaceMethod<" " , " bool" , " hasPointerAttr" , (ins), [{}],
2323 /* defaultImplementation=*/ [{
24- return $_attr.getAstDecl ()->template hasAttr < clang::PointerAttr >();
24+ return $_attr.getAstDecl ()->template hasAttr <clang::PointerAttr>();
2525 }]
2626 >,
2727 InterfaceMethod<" " , " bool" , " hasInitPriorityAttr" , (ins), [{}],
2828 /* defaultImplementation=*/ [{
29- return $_attr.getAstDecl ()->template hasAttr < clang::InitPriorityAttr >();
29+ return $_attr.getAstDecl ()->template hasAttr <clang::InitPriorityAttr>();
3030 }]
3131 >
3232 ];
@@ -93,14 +93,14 @@ let cppNamespace = "::mlir::cir" in {
9393 let methods = [
9494 InterfaceMethod<" " , " bool" , " isCopyAssignmentOperator" , (ins), [{}],
9595 /* defaultImplementation=*/ [{
96- if (auto decl = dyn_cast< clang::CXXMethodDecl >($_attr.getAstDecl ()))
96+ if (auto decl = dyn_cast<clang::CXXMethodDecl>($_attr.getAstDecl ()))
9797 return decl->isCopyAssignmentOperator ();
9898 return false ;
9999 }]
100100 >,
101101 InterfaceMethod<" " , " bool" , " isMoveAssignmentOperator" , (ins), [{}],
102102 /* defaultImplementation=*/ [{
103- if (auto decl = dyn_cast< clang::CXXMethodDecl >($_attr.getAstDecl ()))
103+ if (auto decl = dyn_cast<clang::CXXMethodDecl>($_attr.getAstDecl ()))
104104 return decl->isMoveAssignmentOperator ();
105105 return false ;
106106 }]
@@ -149,29 +149,20 @@ let cppNamespace = "::mlir::cir" in {
149149 ];
150150 }
151151
152- def ASTEnumDeclInterface : AttrInterface<" ASTEnumDeclInterface" ,
153- [ASTTagDeclInterface]>;
154-
155152 def ASTRecordDeclInterface : AttrInterface<" ASTRecordDeclInterface" ,
156- [ASTTagDeclInterface]>;
157-
158- def ASTCXXRecordDeclInterface : AttrInterface<" ASTCXXRecordDeclInterface" ,
159- [ASTRecordDeclInterface]> {
153+ [ASTTagDeclInterface]> {
160154 let methods = [
161155 InterfaceMethod<" " , " bool" , " isLambda" , (ins), [{}],
162156 /* defaultImplementation=*/ [{
163- return $_attr.getAstDecl ()->isLambda ();
157+ if (auto ast = clang::dyn_cast<clang::CXXRecordDecl>($_attr.getAstDecl ()))
158+ return ast->isLambda ();
159+ return false ;
164160 }]
165- >
166- ];
167- }
168-
169- def ASTClassTemplateSpecializationDeclInterface :
170- AttrInterface<" ASTClassTemplateSpecializationDeclInterface" ,
171- [ASTCXXRecordDeclInterface]> {
172- let methods = [
173- InterfaceMethod<" " , " bool" , " hasPromiseType" , (ins), [{}],
161+ >,
162+ InterfaceMethod<" " , " bool" , " hasPromiseType" , (ins), [{}],
174163 /* defaultImplementation=*/ [{
164+ if (!clang::isa<clang::ClassTemplateSpecializationDecl>($_attr.getAstDecl ()))
165+ return false ;
175166 for (const auto *sub : $_attr.getAstDecl ()->decls ()) {
176167 if (auto subRec = clang::dyn_cast<clang::CXXRecordDecl>(sub)) {
177168 if (subRec->getDeclName ().isIdentifier () &&
@@ -186,11 +177,6 @@ let cppNamespace = "::mlir::cir" in {
186177 ];
187178 }
188179
189- def ASTClassTemplatePartialSpecializationDeclInterface :
190- AttrInterface<" ASTClassTemplatePartialSpecializationDeclInterface" ,
191- [ASTClassTemplateSpecializationDeclInterface]>;
192-
193-
194180 def AnyASTFunctionDeclAttr : Attr<
195181 CPred<" ::mlir::isa<::mlir::cir::ASTFunctionDeclInterface>($_self)" >,
196182 " AST Function attribute" > {
0 commit comments