[PATCH] D41579: [X86] A fix for pr35741 - can't use comments with instr prefixes

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 10:30:59 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL321459: It's a fix for Bug 35741 - can't use  comments after x86 prefixes. (authored by avt77, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D41579?vs=128157&id=128181#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D41579

Files:
  llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
  llvm/trunk/test/MC/X86/x86-64.s


Index: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2377,10 +2377,11 @@
     Flags |= Prefix;
     Name = Parser.getTok().getString();
     Parser.Lex(); // eat the prefix
-    // Hack: we could have something like
+    // Hack: we could have something like "rep # some comment" or
     //    "lock; cmpxchg16b $1" or "lock\0A\09incl" or "lock/incl"
     while (Name.startswith(";") || Name.startswith("\n") ||
-           Name.startswith("\t") || Name.startswith("/")) {
+           Name.startswith("#") || Name.startswith("\t") ||
+           Name.startswith("/")) {
       Name = Parser.getTok().getString();
       Parser.Lex(); // go to next prefix or instr
     }
Index: llvm/trunk/test/MC/X86/x86-64.s
===================================================================
--- llvm/trunk/test/MC/X86/x86-64.s
+++ llvm/trunk/test/MC/X86/x86-64.s
@@ -99,6 +99,10 @@
 // CHECK: shll $2, %eax
         sall $2, %eax
 
+// CHECK: rep movsb
+rep     # comment
+movsb
+
 // CHECK: rep
 // CHECK: insb
         rep;insb


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41579.128181.patch
Type: text/x-patch
Size: 1210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171226/65bc15b9/attachment.bin>


More information about the llvm-commits mailing list