aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 8ec4ea1..4cc3fcd 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -690,8 +690,8 @@ Constant *llvm::ConstantFoldLoadFromConst(Constant *C, Type *Ty,
}
Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
+ APInt Offset,
const DataLayout &DL) {
- APInt Offset(DL.getIndexTypeSizeInBits(C->getType()), 0);
C = cast<Constant>(C->stripAndAccumulateConstantOffsets(
DL, Offset, /* AllowNonInbounds */ true));
@@ -715,6 +715,12 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
return nullptr;
}
+Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
+ const DataLayout &DL) {
+ APInt Offset(DL.getIndexTypeSizeInBits(C->getType()), 0);
+ return ConstantFoldLoadFromConstPtr(C, Ty, Offset, DL);
+}
+
namespace {
/// One of Op0/Op1 is a constant expression.