diff options
author | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2019-04-24 06:55:50 +0000 |
---|---|---|
committer | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2019-04-24 06:55:50 +0000 |
commit | 71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab (patch) | |
tree | 733de499705847250087e8f5a20cb95267c2e819 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 1e413ffa7bc8939af283ab54a5dfe7ede54b1ec7 (diff) | |
download | bcm5719-llvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.tar.gz bcm5719-llvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.zip |
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/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 818f1ada04b..46dd0bf1316 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6463,12 +6463,12 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { const int64_t ObjectSize = cast<ConstantInt>(I.getArgOperand(0))->getSExtValue(); Value *const ObjectPtr = I.getArgOperand(1); - SmallVector<Value *, 4> Allocas; + SmallVector<const Value *, 4> Allocas; GetUnderlyingObjects(ObjectPtr, Allocas, *DL); - for (SmallVectorImpl<Value*>::iterator Object = Allocas.begin(), + for (SmallVectorImpl<const Value*>::iterator Object = Allocas.begin(), E = Allocas.end(); Object != E; ++Object) { - AllocaInst *LifetimeObject = dyn_cast_or_null<AllocaInst>(*Object); + const AllocaInst *LifetimeObject = dyn_cast_or_null<AllocaInst>(*Object); // Could not find an Alloca. if (!LifetimeObject) |