diff options
| author | Dan Gohman <gohman@apple.com> | 2009-05-09 00:14:52 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-05-09 00:14:52 +0000 |
| commit | 30f24fe769f9649c6362c7d13e9229e15b0bb72c (patch) | |
| tree | 2b7bd9e06ebd0c9d13386c512e584eaf34cfce88 /llvm/lib/Analysis | |
| parent | d35272f96ba2bd69f37ca346057f9b7f5d4379ff (diff) | |
| download | bcm5719-llvm-30f24fe769f9649c6362c7d13e9229e15b0bb72c.tar.gz bcm5719-llvm-30f24fe769f9649c6362c7d13e9229e15b0bb72c.zip | |
Don't attempt to handle unsized types in ScalarEvolution's GEP analyzer.
llvm-svn: 71302
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index c53d1f5aaea..3f2656240e4 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1935,6 +1935,9 @@ SCEVHandle ScalarEvolution::createNodeForGEP(User *GEP) { 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()), |

