diff options
| author | David Blaikie <dblaikie@gmail.com> | 2015-05-21 00:06:38 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2015-05-21 00:06:38 +0000 |
| commit | f87cc6d3abab9004a345417c00c737a4d98cb729 (patch) | |
| tree | 79e2688620465a80247ec98c6be177b2ba723778 /llvm/lib/IR/ConstantFold.cpp | |
| parent | cafb89df1e4dc90ceb9558b2b2ce61f018004963 (diff) | |
| download | bcm5719-llvm-f87cc6d3abab9004a345417c00c737a4d98cb729.tar.gz bcm5719-llvm-f87cc6d3abab9004a345417c00c737a4d98cb729.zip | |
[opaque pointer type] Pass explicit pointee type in another case of GEP constant folding
llvm-svn: 237860
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
| -rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 16b113df1b8..3f64c43e902 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -2221,7 +2221,7 @@ static Constant *ConstantFoldGetElementPtrImpl(Type *PointeeTy, Constant *C, if (!NewIdxs.empty()) { for (unsigned i = 0, e = Idxs.size(); i != e; ++i) if (!NewIdxs[i]) NewIdxs[i] = cast<Constant>(Idxs[i]); - return ConstantExpr::getGetElementPtr(nullptr, C, NewIdxs, inBounds); + return ConstantExpr::getGetElementPtr(PointeeTy, C, NewIdxs, inBounds); } // If all indices are known integers and normalized, we can do a simple |

