From 33c55bdfed027313b05217d7049aa0e810da5caa Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Thu, 11 Apr 2013 23:57:04 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179343 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmParser/X86AsmParser.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 946f0e90ff9..3a385df431b 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -1449,9 +1449,15 @@ X86Operand *X86AsmParser::ParseIntelOperator(unsigned OpKind) { 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(Val)) { @@ -1462,7 +1468,10 @@ X86Operand *X86AsmParser::ParseIntelOperator(unsigned OpKind) { 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) { -- 2.34.1