In emitting code for a GEP instr, iterate over GEPTypes because there is one
authorMisha Brukman <brukman+llvm@gmail.com>
Thu, 24 Jun 2004 21:54:47 +0000 (21:54 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Thu, 24 Jun 2004 21:54:47 +0000 (21:54 +0000)
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

lib/Target/PowerPC/PPC32ISelSimple.cpp
lib/Target/PowerPC/PowerPCISelSimple.cpp

index cea9de6b81cc8147e3efd48dd3950b109ab3370e..33f979dac689e72f19f61e80c66d5e576a811175 100644 (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();
index cea9de6b81cc8147e3efd48dd3950b109ab3370e..33f979dac689e72f19f61e80c66d5e576a811175 100644 (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();