From 53d771aafdbe5b919f264f53cba3788e2c4cffd2 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 24 Jan 2017 08:32:59 +0000 Subject: Import LLVM 4.0.0 rc1 including clang and lld to help the current development effort on OpenBSD/arm64. --- gnu/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gnu/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp') diff --git a/gnu/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/gnu/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 1eb4f7d1934..923f6e7147d 100644 --- a/gnu/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/gnu/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -999,7 +999,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I, uint64_t Total = 0; for (; I != E; ++I) { - if (StructType *STy = dyn_cast(*I)) { + if (StructType *STy = I.getStructTypeOrNull()) { const StructLayout *SLO = getDataLayout().getStructLayout(STy); const ConstantInt *CPU = cast(I.getOperand()); @@ -1007,7 +1007,6 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I, Total += SLO->getElementOffset(Index); } else { - SequentialType *ST = cast(*I); // Get the index number for the array... which must be long type... GenericValue IdxGV = getOperandValue(I.getOperand(), SF); @@ -1020,7 +1019,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I, assert(BitWidth == 64 && "Invalid index type for getelementptr"); Idx = (int64_t)IdxGV.IntVal.getZExtValue(); } - Total += getDataLayout().getTypeAllocSize(ST->getElementType()) * Idx; + Total += getDataLayout().getTypeAllocSize(I.getIndexedType()) * Idx; } } -- cgit v1.2.3-59-g8ed1b