llvm.org GIT mirror llvm / de1adee
[X86][Asm] Allow negative immediate to appear before bracketed expression Currently, only non-negative immediate is allowed prior to a brac expression (memory reference). MASM / GAS does not have any problem cope with the left side of the real line, so we should be able to as well. Differntial Revision: https://reviews.llvm.org/D36229 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310528 91177308-0d34-0410-b5e6-96231b3b80d8 Coby Tayree 2 years ago
2 changed file(s) with 2 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
6565 AsmRewriteKind Kind;
6666 SMLoc Loc;
6767 unsigned Len;
68 unsigned Val;
68 int64_t Val;
6969 StringRef Label;
7070
7171 public:
72 AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len = 0, unsigned val = 0)
72 AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len = 0, int64_t val = 0)
7373 : Kind(kind), Loc(loc), Len(len), Val(val) {}
7474 AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len, StringRef label)
7575 : Kind(kind), Loc(loc), Len(len), Val(0), Label(label) {}
19611961 return X86Operand::CreateImm(ImmExpr, Start, End);
19621962 }
19631963
1964 // Only positive immediates are valid.
1965 if (Imm < 0)
1966 return ErrorOperand(Start, "expected a positive immediate displacement "
1967 "before bracketed expr.");
1968
19691964 return ParseIntelBracExpression(/*SegReg=*/0, Start, Imm, isSymbol, Size);
19701965 }
19711966