Skip to content

Commit

Permalink
hl: Add flatten and target attrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Nov 4, 2024
1 parent 57aca21 commit 4448845
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/vast/Dialect/HighLevel/HighLevelAttributes.td
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,31 @@ class HighLevel_FlatSymbolReferringAttr<string name, string attr_mnemonic>
}

def HighLevel_AnnotationAttr : HighLevel_NameAttr< "Annotation", "annotation" >;
def HighLevel_FlattentAttr : HighLevel_Attr< "Flatten", "flatten" >;
def HighLevel_FormatAttr : HighLevel_NameAttr< "Format", "format" >;
def HighLevel_FormatArgAttr : HighLevel_NameAttr< "FormatArg", "format_arg" >
{
let parameters = (ins "unsigned":$format_idx);
let assemblyFormat = "`<` $format_idx `>`";
}
def HighLevel_SectionAttr : HighLevel_NameAttr< "Section", "section" >;

def HighLevel_TargetAttr : HighLevel_Attr< "Target", "target" >
{
let parameters = (ins "mlir::StringAttr":$features);

let builders = [
AttrBuilderWithInferredContext<(ins "::mlir::StringAttr":$features), [{
return get(features.getContext(), features);
}]>,
AttrBuilder<(ins "::mlir::StringRef":$features), [{
return get(mlir::StringAttr::get($_ctxt, features));
}]>,
];

let assemblyFormat = "`<` $features `>`";
}

def HighLevel_AliasAttr : HighLevel_NameAttr< "Alias", "alias" >;
def HighLevel_ErrorAttr : HighLevel_NameAttr< "Error", "error" >;
def HighLevel_CountedByAttr : HighLevel_Attr< "CountedBy", "counted_by" >;
Expand Down

0 comments on commit 4448845

Please sign in to comment.