mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
In emitting code for a GEP instr, iterate over GEPTypes because there is one
more operand in GEPOps than there are types in GEPTypes: the pointer that is the first operand of the GEP instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5b636315a9
commit
98649d1796
@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#define DEBUG_TYPE "isel"
|
||||||
#include "PowerPC.h"
|
#include "PowerPC.h"
|
||||||
#include "PowerPCInstrBuilder.h"
|
#include "PowerPCInstrBuilder.h"
|
||||||
#include "PowerPCInstrInfo.h"
|
#include "PowerPCInstrInfo.h"
|
||||||
@ -24,6 +25,8 @@
|
|||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include <vector>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -2594,7 +2597,7 @@ void ISel::emitGEPOperation(MachineBasicBlock *MBB,
|
|||||||
gep_type_end(Src->getType(), IdxBegin, IdxEnd));
|
gep_type_end(Src->getType(), IdxBegin, IdxEnd));
|
||||||
|
|
||||||
// Keep emitting instructions until we consume the entire GEP instruction.
|
// Keep emitting instructions until we consume the entire GEP instruction.
|
||||||
while (!GEPOps.empty()) {
|
while (!GEPTypes.empty()) {
|
||||||
// It's an array or pointer access: [ArraySize x ElementType].
|
// It's an array or pointer access: [ArraySize x ElementType].
|
||||||
const SequentialType *SqTy = cast<SequentialType>(GEPTypes.back());
|
const SequentialType *SqTy = cast<SequentialType>(GEPTypes.back());
|
||||||
Value *idx = GEPOps.back();
|
Value *idx = GEPOps.back();
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#define DEBUG_TYPE "isel"
|
||||||
#include "PowerPC.h"
|
#include "PowerPC.h"
|
||||||
#include "PowerPCInstrBuilder.h"
|
#include "PowerPCInstrBuilder.h"
|
||||||
#include "PowerPCInstrInfo.h"
|
#include "PowerPCInstrInfo.h"
|
||||||
@ -24,6 +25,8 @@
|
|||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
|
#include "Support/Debug.h"
|
||||||
|
#include <vector>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -2594,7 +2597,7 @@ void ISel::emitGEPOperation(MachineBasicBlock *MBB,
|
|||||||
gep_type_end(Src->getType(), IdxBegin, IdxEnd));
|
gep_type_end(Src->getType(), IdxBegin, IdxEnd));
|
||||||
|
|
||||||
// Keep emitting instructions until we consume the entire GEP instruction.
|
// Keep emitting instructions until we consume the entire GEP instruction.
|
||||||
while (!GEPOps.empty()) {
|
while (!GEPTypes.empty()) {
|
||||||
// It's an array or pointer access: [ArraySize x ElementType].
|
// It's an array or pointer access: [ArraySize x ElementType].
|
||||||
const SequentialType *SqTy = cast<SequentialType>(GEPTypes.back());
|
const SequentialType *SqTy = cast<SequentialType>(GEPTypes.back());
|
||||||
Value *idx = GEPOps.back();
|
Value *idx = GEPOps.back();
|
||||||
|
Loading…
Reference in New Issue
Block a user