[llvm-commits] [llvm] r71302 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Fri May 8 17:14:52 PDT 2009
Author: djg
Date: Fri May 8 19:14:52 2009
New Revision: 71302
URL: http://llvm.org/viewvc/llvm-project?rev=71302&view=rev
Log:
Don't attempt to handle unsized types in ScalarEvolution's GEP analyzer.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=71302&r1=71301&r2=71302&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri May 8 19:14:52 2009
@@ -1935,6 +1935,9 @@
const Type *IntPtrTy = TD->getIntPtrType();
Value *Base = GEP->getOperand(0);
+ // Don't attempt to analyze GEPs over unsized objects.
+ if (!cast<PointerType>(Base->getType())->getElementType()->isSized())
+ return getUnknown(GEP);
SCEVHandle TotalOffset = getIntegerSCEV(0, IntPtrTy);
gep_type_iterator GTI = gep_type_begin(GEP);
for (GetElementPtrInst::op_iterator I = next(GEP->op_begin()),
More information about the llvm-commits
mailing list