mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -769,14 +769,14 @@ static void executeFreeInst(FreeInst &I, ExecutionContext &SF) {
|
||||
// the offset that arguments ArgOff+1 -> NumArgs specify for the pointer type
|
||||
// specified by argument Arg.
|
||||
//
|
||||
static PointerTy getElementOffset(MemAccessInst &I, ExecutionContext &SF) {
|
||||
static PointerTy getElementOffset(GetElementPtrInst &I, ExecutionContext &SF) {
|
||||
assert(isa<PointerType>(I.getPointerOperand()->getType()) &&
|
||||
"Cannot getElementOffset of a nonpointer type!");
|
||||
|
||||
PointerTy Total = 0;
|
||||
const Type *Ty = I.getPointerOperand()->getType();
|
||||
|
||||
unsigned ArgOff = I.getFirstIndexOperandNumber();
|
||||
unsigned ArgOff = 1;
|
||||
while (ArgOff < I.getNumOperands()) {
|
||||
if (const StructType *STy = dyn_cast<StructType>(Ty)) {
|
||||
const StructLayout *SLO = TD.getStructLayout(STy);
|
||||
@ -806,8 +806,7 @@ static PointerTy getElementOffset(MemAccessInst &I, ExecutionContext &SF) {
|
||||
if (Idx >= AT->getNumElements() && ArrayChecksEnabled) {
|
||||
cerr << "Out of range memory access to element #" << Idx
|
||||
<< " of a " << AT->getNumElements() << " element array."
|
||||
<< " Subscript #" << (ArgOff-I.getFirstIndexOperandNumber())
|
||||
<< "\n";
|
||||
<< " Subscript #" << (ArgOff-1) << "\n";
|
||||
// Get outta here!!!
|
||||
siglongjmp(SignalRecoverBuffer, SIGTRAP);
|
||||
}
|
||||
|
Reference in New Issue
Block a user