Drop the trailing newline from the FuncOp syntax.

The ModulePrinter prints the newline now for children of the top-level module. This also fixes the location printing for functions as the location used to be printed on a different line.

PiperOrigin-RevId: 257447633
This commit is contained in:
River Riddle 2019-07-10 11:34:57 -07:00 committed by jpienaar
parent 054e25c079
commit 1b247a1247
2 changed files with 2 additions and 5 deletions

View File

@ -1622,7 +1622,7 @@ void ModulePrinter::print(ModuleOp module) {
auto *moduleBody = module.getBody();
for (auto &op : llvm::make_range(moduleBody->begin(), --moduleBody->end())) {
opPrinter.print(&op);
os << '\n';
os << "\n\n";
}
}

View File

@ -236,12 +236,9 @@ void FuncOp::print(OpAsmPrinter *p) {
}
// Print the body if this is not an external function.
if (!isExternal()) {
if (!isExternal())
p->printRegion(getBody(), /*printEntryBlockArgs=*/false,
/*printBlockTerminators=*/true);
*p << '\n';
}
*p << '\n';
}
LogicalResult FuncOp::verify() {