llvm.org GIT mirror llvm / f62454a
Merging r203146: ------------------------------------------------------------------------ r203146 | reid | 2014-03-06 14:19:12 -0500 (Thu, 06 Mar 2014) | 6 lines MS asm: The initial dot in struct access is optional Fixes PR18994. Tests, once again, in that other repository. =P ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@205814 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
2 changed file(s) with 21 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
42914291 break;
42924292 }
42934293 case AOK_DotOperator:
4294 // Insert the dot if the user omitted it.
4295 OS.flush();
4296 if (AsmStringIR.at(AsmStringIR.size() - 1) != '.')
4297 OS << '.';
42944298 OS << (*I).Val;
42954299 break;
42964300 }
13111311 if (getParser().parsePrimaryExpr(Val, End))
13121312 return Error(Tok.getLoc(), "Unexpected identifier!");
13131313 } else {
1314 InlineAsmIdentifierInfo &Info = SM.getIdentifierInfo();
1315 if (ParseIntelIdentifier(Val, Identifier, Info,
1316 /*Unevaluated=*/false, End))
1317 return true;
1314 // This is a dot operator, not an adjacent identifier.
1315 if (Identifier.find('.') != StringRef::npos) {
1316 return false;
1317 } else {
1318 InlineAsmIdentifierInfo &Info = SM.getIdentifierInfo();
1319 if (ParseIntelIdentifier(Val, Identifier, Info,
1320 /*Unevaluated=*/false, End))
1321 return true;
1322 }
13181323 }
13191324 SM.onIdentifierExpr(Val, Identifier);
13201325 UpdateLocLex = false;
13781383 Disp = MCConstantExpr::Create(SM.getImm(), getContext());
13791384 }
13801385
1381 // Parse the dot operator (e.g., [ebx].foo.bar).
1382 if (Tok.getString().startswith(".")) {
1386 // Parse struct field access. Intel requires a dot, but MSVC doesn't. MSVC
1387 // will in fact do global lookup the field name inside all global typedefs,
1388 // but we don't emulate that.
1389 if (Tok.getString().find('.') != StringRef::npos) {
13831390 const MCExpr *NewDisp;
13841391 if (ParseIntelDotOperator(Disp, NewDisp))
13851392 return 0;
15311538 else
15321539 return Error(Tok.getLoc(), "Non-constant offsets are not supported!");
15331540
1534 // Drop the '.'.
1535 StringRef DotDispStr = Tok.getString().drop_front(1);
1541 // Drop the optional '.'.
1542 StringRef DotDispStr = Tok.getString();
1543 if (DotDispStr.startswith("."))
1544 DotDispStr = DotDispStr.drop_front(1);
15361545
15371546 // .Imm gets lexed as a real.
15381547 if (Tok.is(AsmToken::Real)) {