[PATCH] D82478: [MIR] Fix CFI_INSTRUCTION escape printing

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 10:15:39 PDT 2020


scott.linder updated this revision to Diff 273084.
scott.linder marked 2 inline comments as done.
scott.linder added a comment.

Simplify test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82478/new/

https://reviews.llvm.org/D82478

Files:
  llvm/lib/CodeGen/MachineOperand.cpp
  llvm/test/CodeGen/MIR/AArch64/cfi.mir
  llvm/test/CodeGen/MIR/Generic/cfi-escape.mir


Index: llvm/test/CodeGen/MIR/Generic/cfi-escape.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/MIR/Generic/cfi-escape.mir
@@ -0,0 +1,11 @@
+# RUN: llc -run-pass none -o - %s | llc -x=mir -run-pass none -o - | FileCheck %s
+
+# Check that we don't print a trailing comma for CFI escape indices, and that
+# in general we can round trip them.
+
+name: func
+# CHECK-LABEL: name: func
+body: |
+  bb.0:
+    CFI_INSTRUCTION escape 0x61, 0x62, 0x63
+    ; CHECK: CFI_INSTRUCTION escape 0x61, 0x62, 0x63{{$}}
Index: llvm/test/CodeGen/MIR/AArch64/cfi.mir
===================================================================
--- llvm/test/CodeGen/MIR/AArch64/cfi.mir
+++ llvm/test/CodeGen/MIR/AArch64/cfi.mir
@@ -42,7 +42,7 @@
     CFI_INSTRUCTION restore_state
     ; CHECK: CFI_INSTRUCTION restore_state
     CFI_INSTRUCTION escape 0x61, 0x62, 0x63
-    ; CHECK: CFI_INSTRUCTION escape 0x61, 0x62, 0x63
+    ; CHECK: CFI_INSTRUCTION escape 0x61, 0x62, 0x63{{$}}
     CFI_INSTRUCTION window_save
     ; CHECK: CFI_INSTRUCTION window_save
     CFI_INSTRUCTION negate_ra_sign_state
Index: llvm/lib/CodeGen/MachineOperand.cpp
===================================================================
--- llvm/lib/CodeGen/MachineOperand.cpp
+++ llvm/lib/CodeGen/MachineOperand.cpp
@@ -669,7 +669,7 @@
       size_t e = CFI.getValues().size() - 1;
       for (size_t i = 0; i < e; ++i)
         OS << format("0x%02x", uint8_t(CFI.getValues()[i])) << ", ";
-      OS << format("0x%02x", uint8_t(CFI.getValues()[e])) << ", ";
+      OS << format("0x%02x", uint8_t(CFI.getValues()[e]));
     }
     break;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82478.273084.patch
Type: text/x-patch
Size: 1651 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200624/8d85889e/attachment.bin>


More information about the llvm-commits mailing list