[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
This commit is contained in:
Chad Rosier 2013-04-11 23:57:04 +00:00
parent 5ea1ea8db8
commit 33c55bdfed

View File

@ -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<MCSymbolRefExpr>(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) {