As usual, this is a polymorphic hierarchy without polymorphic ownership,
so simply make the dtor protected non-virtual, protected default copy
ctor/assign, and make derived classes final. The derived classes will
pick up correct default public copy ops (and dtor) implicitly.
(wish I could add -Wdeprecated to the build, but last time I tried it
triggered on some system headers I still need to look into/figure out)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250747
91177308-0d34-0410-b5e6-
96231b3b80d8
private:
template <typename MaterializerFtor>
- class LambdaMaterializer : public ValueMaterializer {
+ class LambdaMaterializer final : public ValueMaterializer {
public:
LambdaMaterializer(MaterializerFtor M) : M(std::move(M)) {}
Value* materializeValueFor(Value *V) final {
/// to materialize Values on demand.
class ValueMaterializer {
virtual void anchor(); // Out of line method.
- public:
- virtual ~ValueMaterializer() {}
+ protected:
+ ~ValueMaterializer() = default;
+ ValueMaterializer() = default;
+ ValueMaterializer(const ValueMaterializer&) = default;
+ ValueMaterializer &operator=(const ValueMaterializer&) = default;
+
+ public:
/// materializeValueFor - The client should implement this method if they
/// want to generate a mapped Value on demand. For example, if linking
/// lazily.
/// Creates prototypes for functions that are lazily linked on the fly. This
/// speeds up linking for modules with many/ lazily linked functions of which
/// few get used.
-class ValueMaterializerTy : public ValueMaterializer {
+class ValueMaterializerTy final : public ValueMaterializer {
TypeMapTy &TypeMap;
Module *DstM;
std::vector<GlobalValue *> &LazilyLinkGlobalValues;