mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
ARM Asm parser range checking for [0,31] immediates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135719 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -418,6 +418,14 @@ public:
|
||||
int64_t Value = CE->getValue();
|
||||
return Value >= 0 && Value < 16;
|
||||
}
|
||||
bool isImm0_31() const {
|
||||
if (Kind != Immediate)
|
||||
return false;
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
|
||||
if (!CE) return false;
|
||||
int64_t Value = CE->getValue();
|
||||
return Value >= 0 && Value < 32;
|
||||
}
|
||||
bool isImm0_65535() const {
|
||||
if (Kind != Immediate)
|
||||
return false;
|
||||
@@ -672,6 +680,11 @@ public:
|
||||
addExpr(Inst, getImm());
|
||||
}
|
||||
|
||||
void addImm0_31Operands(MCInst &Inst, unsigned N) const {
|
||||
assert(N == 1 && "Invalid number of operands!");
|
||||
addExpr(Inst, getImm());
|
||||
}
|
||||
|
||||
void addImm0_65535Operands(MCInst &Inst, unsigned N) const {
|
||||
assert(N == 1 && "Invalid number of operands!");
|
||||
addExpr(Inst, getImm());
|
||||
|
Reference in New Issue
Block a user