[opaque pointer type] Access the pointee of the result type from the GEP rather than...
[oota-llvm.git] / include / llvm / IR / Instructions.h
index ff9254372ead2f25c1644d2b06abfbb5196aecee..2571faf3836277eec3a003291af60f58369f18d4 100644 (file)
@@ -876,7 +876,9 @@ public:
         ->getElementType();
   }
 
-  Type *getResultElementType() const { return getType()->getElementType(); }
+  Type *getResultElementType() const {
+    return cast<PointerType>(getType()->getScalarType())->getElementType();
+  }
 
   /// \brief Returns the address space of this instruction's pointer type.
   unsigned getAddressSpace() const {