aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2013-01-31 02:00:45 +0000
committerDan Gohman <dan433584@gmail.com>2013-01-31 02:00:45 +0000
commit20a2ae9df595fc29d748f021dcc7872edde3f517 (patch)
treef2cd71338a87b2bd2fd1ee5a14fc5bb122fb20cf /llvm/lib/Analysis/Loads.cpp
parent37f7e18705f6ce4e41b343ec929f92a93cc65e21 (diff)
downloadllvm-20a2ae9df595fc29d748f021dcc7872edde3f517.zip
llvm-20a2ae9df595fc29d748f021dcc7872edde3f517.tar.gz
llvm-20a2ae9df595fc29d748f021dcc7872edde3f517.tar.bz2
Change GetPointerBaseWithConstantOffset's DataLayout argument from a
reference to a pointer, so that it can handle the case where DataLayout is not available and behave conservatively. llvm-svn: 174024
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r--llvm/lib/Analysis/Loads.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 3158873..0902a39 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -57,8 +57,7 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom,
unsigned Align, const DataLayout *TD) {
int64_t ByteOffset = 0;
Value *Base = V;
- if (TD)
- Base = GetPointerBaseWithConstantOffset(V, ByteOffset, *TD);
+ Base = GetPointerBaseWithConstantOffset(V, ByteOffset, TD);
if (ByteOffset < 0) // out of bounds
return false;