mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-29 13:18:23 +00:00
Devirtualize Constant::destroyConstant.
This reorganizes destroyConstant and destroyConstantImpl. Now there is only destroyConstant in Constant itself, while subclasses are required to implement destroyConstantImpl. destroyConstantImpl no longer calls delete but is instead only responsible for removing the constant from any maps in which it is contained. Reviewed by Duncan Exon Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240471 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -47,7 +47,6 @@ protected:
|
||||
Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
|
||||
: User(ty, vty, Ops, NumOps) {}
|
||||
|
||||
void destroyConstantImpl();
|
||||
void replaceUsesOfWithOnConstantImpl(Constant *Replacement);
|
||||
|
||||
public:
|
||||
@@ -126,14 +125,14 @@ public:
|
||||
/// vector of constant integers, all equal, and the common value is returned.
|
||||
const APInt &getUniqueInteger() const;
|
||||
|
||||
/// destroyConstant - Called if some element of this constant is no longer
|
||||
/// valid. At this point only other constants may be on the use_list for this
|
||||
/// Called if some element of this constant is no longer valid.
|
||||
/// At this point only other constants may be on the use_list for this
|
||||
/// constant. Any constants on our Use list must also be destroy'd. The
|
||||
/// implementation must be sure to remove the constant from the list of
|
||||
/// available cached constants. Implementations should call
|
||||
/// destroyConstantImpl as the last thing they do, to destroy all users and
|
||||
/// delete this.
|
||||
virtual void destroyConstant() { llvm_unreachable("Not reached!"); }
|
||||
/// available cached constants. Implementations should implement
|
||||
/// destroyConstantImpl to remove constants from any pools/maps they are
|
||||
/// contained it.
|
||||
void destroyConstant();
|
||||
|
||||
//// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const Value *V) {
|
||||
|
||||
Reference in New Issue
Block a user