[Mlir-commits] [mlir] 75ab43b - [mlir][emitc][NFC] Eliminate the extra newline printout during emitc.switch emission (#129257)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Mar 19 03:02:58 PDT 2025
Author: Andrey Timonin
Date: 2025-03-19T11:02:54+01:00
New Revision: 75ab43b70eef125dbdf1586143fad88a2a61170e
URL: https://github.com/llvm/llvm-project/commit/75ab43b70eef125dbdf1586143fad88a2a61170e
DIFF: https://github.com/llvm/llvm-project/commit/75ab43b70eef125dbdf1586143fad88a2a61170e.diff
LOG: [mlir][emitc][NFC] Eliminate the extra newline printout during emitc.switch emission (#129257)
Before the output was:
```c++
void emitc_switch_ptrdiff_t() {
ptrdiff_t v1 = 1;
switch (v1) {
...
}
return;
}
```
After:
```c++
void emitc_switch_ptrdiff_t() {
ptrdiff_t v1 = 1;
switch (v1) {
...
}
return;
}
```
Added:
Modified:
mlir/lib/Target/Cpp/TranslateToCpp.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
index b00820ffc542b..81016ed2e9a8d 100644
--- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp
+++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
@@ -484,7 +484,7 @@ static LogicalResult printOperation(CppEmitter &emitter,
emitc::SwitchOp switchOp) {
raw_indented_ostream &os = emitter.ostream();
- os << "\nswitch (";
+ os << "switch (";
if (failed(emitter.emitOperand(switchOp.getArg())))
return failure();
os << ") {";
More information about the Mlir-commits
mailing list