[llvm] r250747 - Fix -Wdeprecated regarding ORC copying ValueMaterializers
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 19 15:15:55 PDT 2015
Author: dblaikie
Date: Mon Oct 19 17:15:55 2015
New Revision: 250747
URL: http://llvm.org/viewvc/llvm-project?rev=250747&view=rev
Log:
Fix -Wdeprecated regarding ORC copying ValueMaterializers
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)
Modified:
llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h?rev=250747&r1=250746&r2=250747&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h Mon Oct 19 17:15:55 2015
@@ -44,7 +44,7 @@ class CompileOnDemandLayer {
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 {
Modified: llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h?rev=250747&r1=250746&r2=250747&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h Mon Oct 19 17:15:55 2015
@@ -38,9 +38,14 @@ namespace llvm {
/// 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.
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=250747&r1=250746&r2=250747&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Oct 19 17:15:55 2015
@@ -365,7 +365,7 @@ class ModuleLinker;
/// 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;
More information about the llvm-commits
mailing list