Skip to content

Commit

Permalink
hl: Fix builder formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Sep 10, 2024
1 parent d0874e9 commit 8e722c7
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions include/vast/Dialect/HighLevel/HighLevelOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1630,11 +1630,10 @@ def HighLevel_StaticAssertDecl
let skipDefaultBuilders = 1;
let builders = [
OpBuilder< (ins
"bool":$failed,
CArg< "builder_callback_ref" >:$assertBuilder,
CArg< "maybe_builder_callback_ref", "std::nullopt" >:$messageBuilder
),
[{
"bool":$failed,
CArg< "builder_callback_ref" >:$assertBuilder,
CArg< "maybe_builder_callback_ref", "std::nullopt" >:$messageBuilder
), [{
$_state.addAttribute("failed", $_builder.getBoolAttr(failed));

InsertionGuard guard($_builder);
Expand Down Expand Up @@ -1678,16 +1677,17 @@ def HighLevel_GenericAssocExpr

let skipDefaultBuilders = 1;
let builders = [
OpBuilder< (ins "Type":$type,
CArg< "builder_callback_ref" >:$bodyBuilder,
CArg< "mlir::Type", "mlir::Type()" >:$matchType),
[{
$_state.addTypes(type);
InsertionGuard guard($_builder);
if (matchType) {
$_state.addAttribute("matchType", mlir::TypeAttr::get(matchType));
}
build_region($_builder, $_state, bodyBuilder);
OpBuilder< (ins
"Type":$type,
CArg< "builder_callback_ref" >:$bodyBuilder,
CArg< "mlir::Type", "mlir::Type()" >:$matchType
), [{
$_state.addTypes(type);
InsertionGuard guard($_builder);
if (matchType) {
$_state.addAttribute("matchType", mlir::TypeAttr::get(matchType));
}
build_region($_builder, $_state, bodyBuilder);
}] >
];

Expand All @@ -1704,23 +1704,25 @@ def HighLevel_GenericSelectionExpr

let skipDefaultBuilders = 1;
let builders = [
OpBuilder< (ins "Type":$type,
CArg< "builder_callback_ref" >:$controlBuilder,
CArg< "builder_callback_ref" >:$bodyBuilder,
CArg< "std::optional< unsigned >", "std::nullopt" >:$selected),
[{
OpBuilder< (ins
"Type":$type,
CArg< "builder_callback_ref" >:$controlBuilder,
CArg< "builder_callback_ref" >:$bodyBuilder,
CArg< "std::optional< unsigned >", "std::nullopt" >:$selected
), [{
$_state.addTypes(type);
InsertionGuard guard($_builder);
if (selected)
$_state.addAttribute("selected", $_builder.getIndexAttr(selected.value()));
build_region($_builder, $_state, controlBuilder);
build_region($_builder, $_state, bodyBuilder);
}] >,
OpBuilder< (ins "Type":$type,
"mlir::Type":$controlType,
CArg< "builder_callback_ref" >:$bodyBuilder,
CArg< "std::optional< unsigned >", "std::nullopt" >:$selected),
[{
OpBuilder< (ins
"Type":$type,
"mlir::Type":$controlType,
CArg< "builder_callback_ref" >:$bodyBuilder,
CArg< "std::optional< unsigned >", "std::nullopt" >:$selected
), [{
$_state.addTypes(type);
InsertionGuard guard($_builder);
$_state.addAttribute("controlType", mlir::TypeAttr::get(controlType));
Expand Down

0 comments on commit 8e722c7

Please sign in to comment.