[PATCH] D33278: [LLVM][x86][Inline Asm] - Enum support for MS syntax

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 09:49:25 PDT 2017


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm

Thanks @coby for finding the simplification!



================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1907
     unsigned Len = Tok.getLoc().getPointer() - Start.getPointer();
-    if (StartTok.getString().size() == Len)
-      // Just add a prefix if this wasn't a complex immediate expression.
-      InstInfo->AsmRewrites->emplace_back(AOK_ImmPrefix, Start);
-    else
-      // Otherwise, rewrite the complex expression as a single immediate.
+    if (StartTok.getString().size() != Len || ReplaceEnumIdentifier)
+      // Rewrite the complex expression as a single immediate.
----------------
mharoush wrote:
> coby wrote:
> > you may just perform an AOK_Imm rewrite regardless the complexity of the immediate expression, and neglect 'ReplaceEnumIdentifier'
> Thanks, this seems fine after the condition refinement. Just had to change some of the older inline asm tests which expects the IR statement to contain a binary/octal/hex base immediate value which this rewrite will replace with the decimal value.
Nice. :)


================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:1397-1398
+          }
+        }
+        else {
+          // Notify the SM a variable identifier was found.
----------------
clang-format this


https://reviews.llvm.org/D33278





More information about the llvm-commits mailing list