From 5815b1fd56ad91501c3ea83f897fc0e19676acdc Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Wed, 24 Jun 2015 18:55:24 +0000 Subject: 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 --- llvm/lib/IR/Globals.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/IR/Globals.cpp') 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 -- cgit v1.2.3