[PATCH] D18587: llvm-mc: AsmParser: handle '\v' as an escaped character

Visoiu Mistrih Francis via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 18:24:26 PDT 2016


thegameg created this revision.
thegameg added reviewers: ddunbar, grosbach.
thegameg added a subscriber: llvm-commits.

* lib/MC/MCAsmStreamer.cpp: Print '\v' as the escaped sequence.
* lib/MC/MCParser/AsmParser.cpp: Add '\v' to the escaped characters list.
* test/MC/AsmParser/directive_ascii.s: Update escaped characters test.

http://reviews.llvm.org/D18587

Files:
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCParser/AsmParser.cpp
  test/MC/AsmParser/directive_ascii.s

Index: test/MC/AsmParser/directive_ascii.s
===================================================================
--- test/MC/AsmParser/directive_ascii.s
+++ test/MC/AsmParser/directive_ascii.s
@@ -28,9 +28,9 @@
         .ascii "\1\01\07\08\001\0001\200\0"
         
 # CHECK: TEST5:
-# CHECK: .ascii "\b\f\n\r\t\\\""
+# CHECK: .ascii "\b\f\n\r\t\v\\\""
 TEST5:
-        .ascii "\b\f\n\r\t\\\""
+        .ascii "\b\f\n\r\t\v\\\""
         
 # CHECK: TEST6:
 # CHECK: .byte 66
Index: lib/MC/MCParser/AsmParser.cpp
===================================================================
--- lib/MC/MCParser/AsmParser.cpp
+++ lib/MC/MCParser/AsmParser.cpp
@@ -2480,6 +2480,7 @@
     case 'n': Data += '\n'; break;
     case 'r': Data += '\r'; break;
     case 't': Data += '\t'; break;
+    case 'v': Data += '\v'; break;
     case '"': Data += '"'; break;
     case '\\': Data += '\\'; break;
     }
Index: lib/MC/MCAsmStreamer.cpp
===================================================================
--- lib/MC/MCAsmStreamer.cpp
+++ lib/MC/MCAsmStreamer.cpp
@@ -664,6 +664,7 @@
       case '\n': OS << "\\n"; break;
       case '\r': OS << "\\r"; break;
       case '\t': OS << "\\t"; break;
+      case '\v': OS << "\\v"; break;
       default:
         OS << '\\';
         OS << toOctal(C >> 6);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18587.52014.patch
Type: text/x-patch
Size: 1290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160330/93331b2e/attachment.bin>


More information about the llvm-commits mailing list