[llvm] [WebAssembly] remove instruction after builtin trap (PR #90207)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 05:59:07 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff b467c6b53660dcaa458c2b5d7fbf5f93ee2af910 820e4a8ef5242ff5c085fec0c833b1f49d2e1897 -- llvm/lib/Target/WebAssembly/WebAssemblyCleanCodeAfterTrap.cpp llvm/lib/Target/WebAssembly/WebAssembly.h llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCleanCodeAfterTrap.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCleanCodeAfterTrap.cpp
index 426254b2e5..ee455f11f2 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyCleanCodeAfterTrap.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyCleanCodeAfterTrap.cpp
@@ -1,4 +1,5 @@
-//===-- WebAssemblyCleanCodeAfterTrap.cpp - Argument instruction moving ---------===//
+//===-- WebAssemblyCleanCodeAfterTrap.cpp - Argument instruction moving
+//---------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -43,7 +44,9 @@ public:
   static char ID; // Pass identification, replacement for typeid
   WebAssemblyCleanCodeAfterTrap() : MachineFunctionPass(ID) {}
 
-  StringRef getPassName() const override { return "WebAssembly Clean Unreachable Code After Trap"; }
+  StringRef getPassName() const override {
+    return "WebAssembly Clean Unreachable Code After Trap";
+  }
 
   bool runOnMachineFunction(MachineFunction &MF) override;
 };
@@ -65,10 +68,10 @@ bool WebAssemblyCleanCodeAfterTrap::runOnMachineFunction(MachineFunction &MF) {
 
   bool Changed = false;
 
-  for (MachineBasicBlock & BB : MF) {
+  for (MachineBasicBlock &BB : MF) {
     bool HasTerminator = false;
-    llvm::SmallVector<MachineInstr*> RemoveMI{};
-    for (MachineInstr & MI : BB) {
+    llvm::SmallVector<MachineInstr *> RemoveMI{};
+    for (MachineInstr &MI : BB) {
       if (HasTerminator)
         RemoveMI.push_back(&MI);
       if (MI.hasProperty(MCID::Trap) && MI.isTerminator())
@@ -82,7 +85,7 @@ bool WebAssemblyCleanCodeAfterTrap::runOnMachineFunction(MachineFunction &MF) {
           MI->print(llvm::dbgs());
         }
       });
-      for (MachineInstr * MI : RemoveMI)
+      for (MachineInstr *MI : RemoveMI)
         MI->eraseFromParent();
     }
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/90207


More information about the llvm-commits mailing list