[llvm] r256381 - [X86][ms-inline asm] Add support for memory operands that include structs

Marina Yatsina via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 24 04:09:55 PST 2015


Author: myatsina
Date: Thu Dec 24 06:09:51 2015
New Revision: 256381

URL: http://llvm.org/viewvc/llvm-project?rev=256381&view=rev
Log:
[X86][ms-inline asm] Add support for memory operands that include structs

Add ability to reference struct symbols in memory operands.
Test case will be added on the clang side (review http://reviews.llvm.org/D15749)

Differential Revision: http://reviews.llvm.org/D15748


Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=256381&r1=256380&r2=256381&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Dec 24 06:09:51 2015
@@ -1172,6 +1172,7 @@ bool X86AsmParser::ParseIntelExpression(
   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 @@ bool X86AsmParser::ParseIntelExpression(
             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 @@ bool X86AsmParser::ParseIntelExpression(
 
     if (!Done && UpdateLocLex)
       End = consumeToken();
+
+    PrevTK = TK;
   }
   return false;
 }




More information about the llvm-commits mailing list