summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Globals.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/Globals.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/Globals.cpp')
-rw-r--r--llvm/lib/IR/Globals.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index 49ac236778c..1d0282677bf 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -48,8 +48,8 @@ void GlobalValue::destroyConstantImpl() {
llvm_unreachable("You can't GV->destroyConstantImpl()!");
}
-void GlobalValue::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) {
- llvm_unreachable("You can't GV->replaceUsesOfWithOnConstant()!");
+Value *GlobalValue::handleOperandChangeImpl(Value *From, Value *To, Use *U) {
+ llvm_unreachable("Unsupported class for handleOperandChange()!");
}
/// copyAttributesFrom - copy all additional attributes (those not needed to
OpenPOWER on IntegriCloud