Adjust to the changed StructType interface. In particular, getElementTypes() is...
[oota-llvm.git] / lib / Bytecode / Reader / ConstantReader.cpp
index e8cebcb38fa5ba449431a64e88a417c3cd80fc71..e9e578d0b70f44cbf87009daa57be4b4fc49a5b8 100644 (file)
@@ -233,12 +233,12 @@ Constant *BytecodeParser::parseConstantValue(const unsigned char *&Buf,
 
   case Type::StructTyID: {
     const StructType *ST = cast<StructType>(Ty);
-    const StructType::ElementTypes &ET = ST->getElementTypes();
 
     std::vector<Constant *> Elements;
-    Elements.reserve(ET.size());
-    for (unsigned i = 0; i != ET.size(); ++i)
-      Elements.push_back(getConstantValue(ET[i], read_vbr_uint(Buf, EndBuf)));
+    Elements.reserve(ST->getNumElements());
+    for (unsigned i = 0; i != ST->getNumElements(); ++i)
+      Elements.push_back(getConstantValue(ST->getElementType(i),
+                                          read_vbr_uint(Buf, EndBuf)));
 
     return ConstantStruct::get(ST, Elements);
   }