OSDN Git Service

Fix GlobalISel build.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 2 Dec 2016 02:55:30 +0000 (02:55 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 2 Dec 2016 02:55:30 +0000 (02:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288460 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/GlobalISel/IRTranslator.cpp

index ec255b5..e8d1ce0 100644 (file)
@@ -336,7 +336,7 @@ bool IRTranslator::translateGetElementPtr(const User &U) {
   for (gep_type_iterator GTI = gep_type_begin(&U), E = gep_type_end(&U);
        GTI != E; ++GTI) {
     const Value *Idx = GTI.getOperand();
-    if (StructType *StTy = dyn_cast<StructType>(*GTI)) {
+    if (StructType *StTy = GTI.getStructTypeOrNull()) {
       unsigned Field = cast<Constant>(Idx)->getUniqueInteger().getZExtValue();
       Offset += DL->getStructLayout(StTy)->getElementOffset(Field);
       continue;