[llvm] r179343 - [ms-inline asm] Add support for using the LENGTH, TYPE, and SIZE operators with
Chad Rosier
mcrosier at apple.com
Thu Apr 11 16:57:04 PDT 2013
Author: mcrosier
Date: Thu Apr 11 18:57:04 2013
New Revision: 179343
URL: http://llvm.org/viewvc/llvm-project?rev=179343&view=rev
Log:
[ms-inline asm] Add support for using the LENGTH, TYPE, and SIZE operators with
variables that use namespace alias qualifiers. Test case coming on clang side
shortly.
Part of rdar://13499009
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=179343&r1=179342&r2=179343&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Apr 11 18:57:04 2013
@@ -1449,9 +1449,15 @@ X86Operand *X86AsmParser::ParseIntelOper
assert (Tok.is(AsmToken::Identifier) && "Expected an identifier");
const MCExpr *Val;
+ AsmToken StartTok = Tok;
SMLoc Start = Tok.getLoc(), End;
+ StringRef Identifier = Tok.getString();
if (getParser().parsePrimaryExpr(Val, End))
- return 0;
+ return ErrorOperand(Start, "Unable to parse expression!");
+
+ const MCExpr *Disp = 0;
+ if (X86Operand *Err = ParseIntelVarWithQualifier(Disp, Identifier))
+ return Err;
unsigned Length = 0, Size = 0, Type = 0;
if (const MCSymbolRefExpr *SymRef = dyn_cast<MCSymbolRefExpr>(Val)) {
@@ -1462,7 +1468,10 @@ X86Operand *X86AsmParser::ParseIntelOper
bool IsVarDecl;
if (!SemaCallback->LookupInlineAsmIdentifier(Sym.getName(), NULL, Length,
Size, Type, IsVarDecl))
- return ErrorOperand(Start, "Unable to lookup expr!");
+ // FIXME: We don't warn on variables with namespace alias qualifiers
+ // because support still needs to be added in the frontend.
+ if (Identifier.equals(StartTok.getString()))
+ return ErrorOperand(Start, "Unable to lookup expr!");
}
unsigned CVal;
switch(OpKind) {
More information about the llvm-commits
mailing list