Skip to content

Commit b118bd3

Browse files
committed
[mlir-tblgen] Do not create body for pruned create
1 parent 44df23a commit b118bd3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,11 +2632,13 @@ void OpEmitter::genInlineCreateBody(
26322632
interleaveComma(nonBuilderStateArgsList, nonBuilderStateArgsOS);
26332633
nonBuilderStateArgs = ", " + nonBuilderStateArgs;
26342634
}
2635-
cWithLoc->body() << llvm::formatv(inlineCreateBody, locParamName,
2636-
nonBuilderStateArgs,
2637-
opClass.getClassName());
2638-
cImplicitLoc->body() << llvm::formatv(inlineCreateBodyImplicitLoc,
2639-
nonBuilderStateArgs);
2635+
if (cWithLoc)
2636+
cWithLoc->body() << llvm::formatv(inlineCreateBody, locParamName,
2637+
nonBuilderStateArgs,
2638+
opClass.getClassName());
2639+
if (cImplicitLoc)
2640+
cImplicitLoc->body() << llvm::formatv(inlineCreateBodyImplicitLoc,
2641+
nonBuilderStateArgs);
26402642
}
26412643

26422644
void OpEmitter::genSeparateArgParamBuilder() {

0 commit comments

Comments
 (0)