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.

llvm-svn: 14375
This commit is contained in:
Misha Brukman 2004-06-24 21:54:47 +00:00
parent 1c9de4699a
commit 29b3dd7d35
2 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "isel"
#include "PowerPC.h"
#include "PowerPCInstrBuilder.h"
#include "PowerPCInstrInfo.h"
@ -24,6 +25,8 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/InstVisitor.h"
#include "Support/Debug.h"
#include <vector>
using namespace llvm;
namespace {
@ -2594,7 +2597,7 @@ void ISel::emitGEPOperation(MachineBasicBlock *MBB,
gep_type_end(Src->getType(), IdxBegin, IdxEnd));
// 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].
const SequentialType *SqTy = cast<SequentialType>(GEPTypes.back());
Value *idx = GEPOps.back();

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "isel"
#include "PowerPC.h"
#include "PowerPCInstrBuilder.h"
#include "PowerPCInstrInfo.h"
@ -24,6 +25,8 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/InstVisitor.h"
#include "Support/Debug.h"
#include <vector>
using namespace llvm;
namespace {
@ -2594,7 +2597,7 @@ void ISel::emitGEPOperation(MachineBasicBlock *MBB,
gep_type_end(Src->getType(), IdxBegin, IdxEnd));
// 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].
const SequentialType *SqTy = cast<SequentialType>(GEPTypes.back());
Value *idx = GEPOps.back();