summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-06-24 21:54:47 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-06-24 21:54:47 +0000
commit29b3dd7d3550a48eedc9957a2634937733340667 (patch)
tree50a0c06d0802ae5c2b8123b751349a54b99dc964 /llvm
parent1c9de4699a87a03182b9c31c92440e1d16c5e587 (diff)
downloadbcm5719-llvm-29b3dd7d3550a48eedc9957a2634937733340667.tar.gz
bcm5719-llvm-29b3dd7d3550a48eedc9957a2634937733340667.zip
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
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp5
-rw-r--r--llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
index cea9de6b81c..33f979dac68 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -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();
diff --git a/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp b/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp
index cea9de6b81c..33f979dac68 100644
--- a/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp
+++ b/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp
@@ -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();
OpenPOWER on IntegriCloud