Skip to content

Commit

Permalink
[NFC][Emit] Replace body with bodyRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
nandor committed Mar 11, 2024
1 parent 2e23cda commit 4d5dab5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions include/circt/Dialect/Emit/EmitOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def FileOp : EmitOp<"file", [
filename through an optional symbol.
}];

let regions = (region SizedRegion<1>:$body);
let regions = (region SizedRegion<1>:$bodyRegion);
let arguments = (ins
StrAttr:$file_name,
OptionalAttr<SymbolNameAttr>:$sym_name
);
let results = (outs);

let assemblyFormat = "$file_name (`sym` $sym_name^)? $body attr-dict";
let assemblyFormat = "$file_name (`sym` $sym_name^)? $bodyRegion attr-dict";

let skipDefaultBuilders = 1;
let builders = [
Expand All @@ -61,9 +61,6 @@ def FileOp : EmitOp<"file", [
let extraClassDeclaration = [{
// SymbolOpInterface
static bool isOptionalSymbol() { return true; }

// Utilities
Block *getBodyBlock() { return &getBodyRegion().front(); }
}];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/ExportVerilog/ExportVerilog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6048,7 +6048,7 @@ class FileEmitter : public EmitterBase {
};

void FileEmitter::emit(emit::FileOp op) {
for (Operation &op : *op.getBodyBlock()) {
for (Operation &op : *op.getBody()) {
TypeSwitch<Operation *>(&op)
.Case<emit::VerbatimOp, emit::RefOp>([&](auto op) { emitOp(op); })
.Case<VerbatimOp, IfDefOp, MacroDefOp>(
Expand Down
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Transforms/ExtractInstances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ void ExtractInstancesPass::createTraceFiles() {
};

auto file = getOrCreateFile(fileName);
auto builder = OpBuilder::atBlockEnd(file.getBodyBlock());
auto builder = OpBuilder::atBlockEnd(file.getBody());
for (auto inst : insts) {
StringRef prefix(instPrefices[inst]);
if (prefix.empty()) {
Expand Down

0 comments on commit 4d5dab5

Please sign in to comment.