llvm.org GIT mirror llvm / 023835d
McARM: Add a variety of asserts on the sanity of memory operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123737 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
1 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
414414 }
415415
416416 static ARMOperand *CreateMem(unsigned BaseRegNum, bool OffsetIsReg,
417 const MCExpr *Offset, unsigned OffsetRegNum,
417 const MCExpr *Offset, int OffsetRegNum,
418418 bool OffsetRegShifted, enum ShiftType ShiftType,
419419 const MCExpr *ShiftAmount, bool Preindexed,
420420 bool Postindexed, bool Negative, bool Writeback,
421421 SMLoc S, SMLoc E) {
422 assert((OffsetRegNum == -1 || OffsetIsReg) &&
423 "OffsetRegNum must imply OffsetIsReg!");
424 assert((!OffsetRegShifted || OffsetIsReg) &&
425 "OffsetRegShifted must imply OffsetIsReg!");
426 assert((!ShiftAmount || (OffsetIsReg && OffsetRegShifted)) &&
427 "Cannot have shift amount without shifted register offset!");
428 assert((!Offset || !OffsetIsReg) &&
429 "Cannot have expression offset and register offset!");
430
422431 ARMOperand *Op = new ARMOperand(Memory);
423432 Op->Mem.BaseRegNum = BaseRegNum;
424433 Op->Mem.OffsetIsReg = OffsetIsReg;