mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 18:33:22 +00:00
[ms-inline asm] Emit an error for unsupported SIZE and LENGTH directives.
Part of rdar://12576868 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166792 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
efcb3d9c1c
commit
7ab21c7a05
@ -891,7 +891,7 @@ X86Operand *X86AsmParser::ParseIntelOffsetOfOperator(SMLoc Start) {
|
||||
SMLoc End;
|
||||
const MCExpr *Val;
|
||||
if (getParser().ParseExpression(Val, End))
|
||||
return 0;
|
||||
return ErrorOperand(Start, "Unable to parse expression!");
|
||||
|
||||
End = Parser.getTok().getLoc();
|
||||
|
||||
@ -928,7 +928,7 @@ X86Operand *X86AsmParser::ParseIntelTypeOperator(SMLoc Start) {
|
||||
// identifier.
|
||||
// FIXME: Pass a valid SMLoc.
|
||||
if (!SemaCallback->LookupInlineAsmIdentifier(Sym.getName(), NULL, Size))
|
||||
return ErrorOperand(Start, "Unable to lookup TYPE of expr.");
|
||||
return ErrorOperand(Start, "Unable to lookup TYPE of expr!");
|
||||
|
||||
Size /= 8; // Size is in terms of bits, but we want bytes in the context.
|
||||
}
|
||||
@ -946,16 +946,22 @@ X86Operand *X86AsmParser::ParseIntelOperand() {
|
||||
SMLoc Start = Parser.getTok().getLoc(), End;
|
||||
|
||||
// offset operator.
|
||||
const AsmToken &Tok = Parser.getTok();
|
||||
if ((Tok.getString() == "offset" || Tok.getString() == "OFFSET") &&
|
||||
StringRef AsmTokStr = Parser.getTok().getString();
|
||||
if ((AsmTokStr == "offset" || AsmTokStr == "OFFSET") &&
|
||||
isParsingInlineAsm())
|
||||
return ParseIntelOffsetOfOperator(Start);
|
||||
|
||||
// Type directive.
|
||||
if ((Tok.getString() == "type" || Tok.getString() == "TYPE") &&
|
||||
if ((AsmTokStr == "type" || AsmTokStr == "TYPE") &&
|
||||
isParsingInlineAsm())
|
||||
return ParseIntelTypeOperator(Start);
|
||||
|
||||
// Unsupported directives.
|
||||
if (isParsingIntelSyntax() &&
|
||||
(AsmTokStr == "size" || AsmTokStr == "SIZE" ||
|
||||
AsmTokStr == "length" || AsmTokStr == "LENGTH"))
|
||||
return ErrorOperand(Start, "Unsupported directive!");
|
||||
|
||||
// immediate.
|
||||
if (getLexer().is(AsmToken::Integer) || getLexer().is(AsmToken::Real) ||
|
||||
getLexer().is(AsmToken::Minus)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user