[llvm] r237860 - [opaque pointer type] Pass explicit pointee type in another case of GEP constant folding
David Blaikie
dblaikie at gmail.com
Wed May 20 17:06:38 PDT 2015
Author: dblaikie
Date: Wed May 20 19:06:38 2015
New Revision: 237860
URL: http://llvm.org/viewvc/llvm-project?rev=237860&view=rev
Log:
[opaque pointer type] Pass explicit pointee type in another case of GEP constant folding
Modified:
llvm/trunk/lib/IR/ConstantFold.cpp
Modified: llvm/trunk/lib/IR/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantFold.cpp?rev=237860&r1=237859&r2=237860&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantFold.cpp (original)
+++ llvm/trunk/lib/IR/ConstantFold.cpp Wed May 20 19:06:38 2015
@@ -2221,7 +2221,7 @@ static Constant *ConstantFoldGetElementP
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
More information about the llvm-commits
mailing list