Skip to content

Commit

Permalink
cg: Add target and flatten attr visitors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Nov 4, 2024
1 parent 4448845 commit 96fe67e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/vast/CodeGen/DefaultAttrVisitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ namespace vast::cg {

mlir_attr VisitConstAttr(const clang::ConstAttr *attr);
mlir_attr VisitSectionAttr(const clang::SectionAttr *attr);
mlir_attr VisitTargetAttr(const clang::TargetAttr *attr);
mlir_attr VisitAliasAttr(const clang::AliasAttr *attr);
mlir_attr VisitErrorAttr(const clang::ErrorAttr *attr);
mlir_attr VisitFlattenAttr(const clang::FlattenAttr *attr);
mlir_attr VisitFormatAttr(const clang::FormatAttr *attr);
mlir_attr VisitFormatArgAttr(const clang::FormatArgAttr *attr);
mlir_attr VisitAnnotateAttr(const clang::AnnotateAttr *attr);
Expand Down
8 changes: 8 additions & 0 deletions lib/vast/CodeGen/DefaultAttrVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ namespace vast::cg
return make< hl::SectionAttr >(attr->getName());
}

mlir_attr default_attr_visitor::VisitTargetAttr(const clang::TargetAttr *attr) {
return make< hl::TargetAttr >(attr->getFeaturesStr());
}

mlir_attr default_attr_visitor::VisitAliasAttr(const clang::AliasAttr *attr) {
return make< hl::AliasAttr >(attr->getAliasee());
}
Expand All @@ -22,6 +26,10 @@ namespace vast::cg
return make< hl::ErrorAttr >(attr->getUserDiagnostic());
}

mlir_attr default_attr_visitor::VisitFlattenAttr(const clang::FlattenAttr *attr) {
return make< hl::FlattenAttr >();
}

mlir_attr default_attr_visitor::VisitFormatAttr(const clang::FormatAttr *attr) {
return make< hl::FormatAttr >(attr->getType()->getName());
}
Expand Down

0 comments on commit 96fe67e

Please sign in to comment.