Skip to content

[mlir][emitc][NFC] Eliminate the extra newline printout during emitc.switch emission #129257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

EtoAndruwa
Copy link
Contributor

Before the output was:

void emitc_switch_ptrdiff_t() {
  ptrdiff_t v1 = 1;

  switch (v1) {
  ...
  }
  return;
}

After:

void emitc_switch_ptrdiff_t() {
  ptrdiff_t v1 = 1;
  switch (v1) {
  ...
  }
  return;
}

@llvmbot
Copy link
Member

llvmbot commented Feb 28, 2025

@llvm/pr-subscribers-mlir-emitc

Author: Andrey Timonin (EtoAndruwa)

Changes

Before the output was:

void emitc_switch_ptrdiff_t() {
  ptrdiff_t v1 = 1;

  switch (v1) {
  ...
  }
  return;
}

After:

void emitc_switch_ptrdiff_t() {
  ptrdiff_t v1 = 1;
  switch (v1) {
  ...
  }
  return;
}

Full diff: https://github.com/llvm/llvm-project/pull/129257.diff

1 Files Affected:

  • (modified) mlir/lib/Target/Cpp/TranslateToCpp.cpp (+1-1)
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 << ") {";

@llvmbot
Copy link
Member

llvmbot commented Feb 28, 2025

@llvm/pr-subscribers-mlir

Author: Andrey Timonin (EtoAndruwa)

Changes

Before the output was:

void emitc_switch_ptrdiff_t() {
  ptrdiff_t v1 = 1;

  switch (v1) {
  ...
  }
  return;
}

After:

void emitc_switch_ptrdiff_t() {
  ptrdiff_t v1 = 1;
  switch (v1) {
  ...
  }
  return;
}

Full diff: https://github.com/llvm/llvm-project/pull/129257.diff

1 Files Affected:

  • (modified) mlir/lib/Target/Cpp/TranslateToCpp.cpp (+1-1)
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 << ") {";

@EtoAndruwa
Copy link
Contributor Author

@simon-camp, gentle ping.

@simon-camp
Copy link
Contributor

Sorry, do you want me to merge this?

@EtoAndruwa
Copy link
Contributor Author

Sorry, do you want me to merge this?

Hello, Simon! I don’t have merge rights. Could you please merge this?

@simon-camp simon-camp merged commit 75ab43b into llvm:main Mar 19, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants