[PATCH] D15748: [X86][ms-inline asm] Add support for memory operands that include structs

Marina Yatsina via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 07:22:53 PST 2015


myatsina created this revision.
myatsina added reviewers: rnk, mcrosier.
myatsina added a subscriber: llvm-commits.
myatsina set the repository for this revision to rL LLVM.

Add ability to reference struct symbols in memory operands.
Test case will be added on the clang side.

Repository:
  rL LLVM

http://reviews.llvm.org/D15748

Files:
  lib/Target/X86/AsmParser/X86AsmParser.cpp

Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1172,6 +1172,7 @@
   MCAsmParser &Parser = getParser();
   const AsmToken &Tok = Parser.getTok();
 
+  AsmToken::TokenKind PrevTK = AsmToken::Error;
   bool Done = false;
   while (!Done) {
     bool UpdateLocLex = true;
@@ -1215,7 +1216,8 @@
             return Error(Tok.getLoc(), "Unexpected identifier!");
         } else {
           // This is a dot operator, not an adjacent identifier.
-          if (Identifier.find('.') != StringRef::npos) {
+          if (Identifier.find('.') != StringRef::npos &&
+              PrevTK == AsmToken::RBrac) {
             return false;
           } else {
             InlineAsmIdentifierInfo &Info = SM.getIdentifierInfo();
@@ -1284,6 +1286,8 @@
 
     if (!Done && UpdateLocLex)
       End = consumeToken();
+
+    PrevTK = TK;
   }
   return false;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15748.43535.patch
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151223/acb01996/attachment.bin>


More information about the llvm-commits mailing list