aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/GlobalsModRef.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2019-04-24 06:55:50 +0000
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2019-04-24 06:55:50 +0000
commit71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab (patch)
tree733de499705847250087e8f5a20cb95267c2e819 /llvm/lib/Analysis/GlobalsModRef.cpp
parent1e413ffa7bc8939af283ab54a5dfe7ede54b1ec7 (diff)
downloadllvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.zip
llvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.tar.gz
llvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.tar.bz2
Add "const" in GetUnderlyingObjects. NFC
Summary: Both the input Value pointer and the returned Value pointers in GetUnderlyingObjects are now declared as const. It turned out that all current (in-tree) uses of GetUnderlyingObjects were trivial to update, being satisfied with have those Value pointers declared as const. Actually, in the past several of the users had to use const_cast, just because of ValueTracking not providing a version of GetUnderlyingObjects with "const" Value pointers. With this patch we get rid of those const casts. Reviewers: hfinkel, materi, jkorous Reviewed By: jkorous Subscribers: dexonsmith, jkorous, jholewinski, sdardis, eraman, hiraditya, jrtc27, atanasyan, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61038 llvm-svn: 359072
Diffstat (limited to 'llvm/lib/Analysis/GlobalsModRef.cpp')
-rw-r--r--llvm/lib/Analysis/GlobalsModRef.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index 2c967c8..0d6c0ff 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -896,13 +896,13 @@ ModRefInfo GlobalsAAResult::getModRefInfoForArgument(const CallBase *Call,
// Iterate through all the arguments to the called function. If any argument
// is based on GV, return the conservative result.
for (auto &A : Call->args()) {
- SmallVector<Value*, 4> Objects;
+ SmallVector<const Value*, 4> Objects;
GetUnderlyingObjects(A, Objects, DL);
// All objects must be identified.
if (!all_of(Objects, isIdentifiedObject) &&
// Try ::alias to see if all objects are known not to alias GV.
- !all_of(Objects, [&](Value *V) {
+ !all_of(Objects, [&](const Value *V) {
return this->alias(MemoryLocation(V), MemoryLocation(GV), AAQI) ==
NoAlias;
}))