diff options
author | David Greene <greened@obbligato.org> | 2007-09-04 15:46:09 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2007-09-04 15:46:09 +0000 |
commit | c656cbb8c20d1ea38bdb5d1ac39dbcd0405a98dc (patch) | |
tree | ad78d988fb13e238e6ac3442f47ef77f22f19695 /llvm/lib/VMCore/ConstantFold.cpp | |
parent | 77b97002e955949352d2740f7b47c41f9402dec7 (diff) | |
download | bcm5719-llvm-c656cbb8c20d1ea38bdb5d1ac39dbcd0405a98dc.tar.gz bcm5719-llvm-c656cbb8c20d1ea38bdb5d1ac39dbcd0405a98dc.zip |
Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.
llvm-svn: 41697
Diffstat (limited to 'llvm/lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/VMCore/ConstantFold.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index c950e8d07ff..fb2e65f6ba6 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/lib/VMCore/ConstantFold.cpp @@ -1350,7 +1350,7 @@ Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred, } Constant *llvm::ConstantFoldGetElementPtr(const Constant *C, - Constant* const *Idxs, + Constant* const *Idxs, unsigned NumIdx) { if (NumIdx == 0 || (NumIdx == 1 && Idxs[0]->isNullValue())) @@ -1358,7 +1358,8 @@ Constant *llvm::ConstantFoldGetElementPtr(const Constant *C, if (isa<UndefValue>(C)) { const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), - (Value**)Idxs, NumIdx, + (Value **)Idxs, + (Value **)Idxs+NumIdx, true); assert(Ty != 0 && "Invalid indices for GEP!"); return UndefValue::get(PointerType::get(Ty)); @@ -1374,7 +1375,8 @@ Constant *llvm::ConstantFoldGetElementPtr(const Constant *C, } if (isNull) { const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), - (Value**)Idxs, NumIdx, + (Value**)Idxs, + (Value**)Idxs+NumIdx, true); assert(Ty != 0 && "Invalid indices for GEP!"); return ConstantPointerNull::get(PointerType::get(Ty)); |