summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-06-24 18:55:24 +0000
committerPete Cooper <peter_cooper@apple.com>2015-06-24 18:55:24 +0000
commit5815b1fd56ad91501c3ea83f897fc0e19676acdc (patch)
treec5b868ce04a3f5cfac701bbea3a3f419bfc1f194 /llvm/lib/IR/Value.cpp
parent9dbb5013b75024cefd942921fbbd8fd14bd6f7ab (diff)
downloadbcm5719-llvm-5815b1fd56ad91501c3ea83f897fc0e19676acdc.tar.gz
bcm5719-llvm-5815b1fd56ad91501c3ea83f897fc0e19676acdc.zip
Devirtualize Constant::replaceUsesOfWithOnConstant.
This is part of the work to devirtualize Value. The old pattern was to call replaceUsesOfWithOnConstant which was overridden by subclasses. Those could then call replaceUsesOfWithOnConstantImpl on Constant to handle deleting the current value. To be consistent with other parts of the code, this has been changed so that we call the method on Constant, and that dispatches to an Impl on subclasses. As part of this, it made sense to rename the methods to be more descriptive. The new name is Constant::handleOperandChange, and it requires that all subclasses of Constant implement handleOperandChangeImpl, even if they just throw an error if they shouldn't be called. Reviewed by Duncan Exon Smith. llvm-svn: 240567
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index eb5c2253f4e..78d1adb5e70 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -369,7 +369,7 @@ void Value::replaceAllUsesWith(Value *New) {
// constant because they are uniqued.
if (auto *C = dyn_cast<Constant>(U.getUser())) {
if (!isa<GlobalValue>(C)) {
- C->replaceUsesOfWithOnConstant(this, New, &U);
+ C->handleOperandChange(this, New, &U);
continue;
}
}
OpenPOWER on IntegriCloud