From cecb0183b297e0d483ca7154fd535c030bea39a9 Mon Sep 17 00:00:00 2001 From: Eugene Zelenko Date: Wed, 16 Nov 2016 18:07:33 +0000 Subject: [PATCH] [ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes. Differential revision: https://reviews.llvm.org/D26729 llvm-svn: 287126 --- .../llvm/ExecutionEngine/JITEventListener.h | 18 ++++----- llvm/include/llvm/ExecutionEngine/JITSymbol.h | 15 ++++---- llvm/include/llvm/ExecutionEngine/ObjectCache.h | 12 +++--- .../ExecutionEngine/Orc/CompileOnDemandLayer.h | 44 ++++++++++++++++------ .../llvm/ExecutionEngine/Orc/IndirectionUtils.h | 24 +++++++++--- .../llvm/ExecutionEngine/Orc/LazyEmittingLayer.h | 22 ++++++----- .../llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h | 29 ++++++++------ .../llvm/ExecutionEngine/RTDyldMemoryManager.h | 25 ++++++------ llvm/include/llvm/ExecutionEngine/RuntimeDyld.h | 37 +++++++++++------- .../llvm/ExecutionEngine/SectionMemoryManager.h | 13 ++++--- 10 files changed, 147 insertions(+), 92 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/JITEventListener.h b/llvm/include/llvm/ExecutionEngine/JITEventListener.h index c3edec8..94ec4e3 100644 --- a/llvm/include/llvm/ExecutionEngine/JITEventListener.h +++ b/llvm/include/llvm/ExecutionEngine/JITEventListener.h @@ -18,18 +18,18 @@ #include "RuntimeDyld.h" #include "llvm/Config/llvm-config.h" #include "llvm/IR/DebugLoc.h" -#include "llvm/Support/DataTypes.h" +#include #include namespace llvm { -class Function; + +class IntelJITEventsWrapper; class MachineFunction; class OProfileWrapper; -class IntelJITEventsWrapper; namespace object { class ObjectFile; -} +} // end namespace object /// JITEvent_EmittedFunctionDetails - Helper struct for containing information /// about a generated machine code function. @@ -60,8 +60,8 @@ public: typedef JITEvent_EmittedFunctionDetails EmittedFunctionDetails; public: - JITEventListener() {} - virtual ~JITEventListener() {} + JITEventListener() = default; + virtual ~JITEventListener() = default; /// NotifyObjectEmitted - Called after an object has been successfully /// emitted to memory. NotifyFunctionEmitted will not be called for @@ -105,7 +105,6 @@ public: static JITEventListener *createOProfileJITEventListener( OProfileWrapper* AlternativeImpl); #else - static JITEventListener *createOProfileJITEventListener() { return nullptr; } static JITEventListener *createOProfileJITEventListener( @@ -113,10 +112,11 @@ public: return nullptr; } #endif // USE_OPROFILE + private: virtual void anchor(); }; -} // end namespace llvm. +} // end namespace llvm -#endif // defined LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H +#endif // LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H diff --git a/llvm/include/llvm/ExecutionEngine/JITSymbol.h b/llvm/include/llvm/ExecutionEngine/JITSymbol.h index 658cbe4..8892948 100644 --- a/llvm/include/llvm/ExecutionEngine/JITSymbol.h +++ b/llvm/include/llvm/ExecutionEngine/JITSymbol.h @@ -14,10 +14,12 @@ #ifndef LLVM_EXECUTIONENGINE_JITSYMBOL_H #define LLVM_EXECUTIONENGINE_JITSYMBOL_H -#include "llvm/Support/DataTypes.h" -#include +#include #include +#include +#include #include +#include namespace llvm { @@ -25,7 +27,7 @@ class GlobalValue; namespace object { class BasicSymbolRef; -} +} // end namespace object /// @brief Represents an address in the target process's address space. typedef uint64_t JITTargetAddress; @@ -33,7 +35,6 @@ typedef uint64_t JITTargetAddress; /// @brief Flags for symbols in the JIT. class JITSymbolFlags { public: - typedef uint8_t UnderlyingType; enum FlagNames : UnderlyingType { @@ -86,7 +87,6 @@ private: /// @brief Represents a symbol that has been evaluated to an address already. class JITEvaluatedSymbol { public: - /// @brief Create a 'null' symbol. JITEvaluatedSymbol(std::nullptr_t) : Address(0) {} @@ -112,7 +112,6 @@ private: /// @brief Represents a symbol in the JIT. class JITSymbol { public: - typedef std::function GetAddressFtor; /// @brief Create a 'null' symbol that represents failure to find a symbol @@ -165,7 +164,7 @@ private: /// \brief Symbol resolution. class JITSymbolResolver { public: - virtual ~JITSymbolResolver() {} + virtual ~JITSymbolResolver() = default; /// This method returns the address of the specified symbol if it exists /// within the logical dynamic library represented by this JITSymbolResolver. @@ -193,6 +192,6 @@ private: virtual void anchor(); }; -} // End namespace llvm. +} // end namespace llvm #endif // LLVM_EXECUTIONENGINE_JITSYMBOL_H diff --git a/llvm/include/llvm/ExecutionEngine/ObjectCache.h b/llvm/include/llvm/ExecutionEngine/ObjectCache.h index cc01a4e..0770444 100644 --- a/llvm/include/llvm/ExecutionEngine/ObjectCache.h +++ b/llvm/include/llvm/ExecutionEngine/ObjectCache.h @@ -1,4 +1,4 @@ -//===-- ObjectCache.h - Class definition for the ObjectCache -----C++ -*-===// +//===-- ObjectCache.h - Class definition for the ObjectCache ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -11,6 +11,7 @@ #define LLVM_EXECUTIONENGINE_OBJECTCACHE_H #include "llvm/Support/MemoryBuffer.h" +#include namespace llvm { @@ -21,10 +22,11 @@ class Module; /// have already been compiled and an object file is available. class ObjectCache { virtual void anchor(); + public: - ObjectCache() { } + ObjectCache() = default; - virtual ~ObjectCache() { } + virtual ~ObjectCache() = default; /// notifyObjectCompiled - Provides a pointer to compiled code for Module M. virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) = 0; @@ -35,6 +37,6 @@ public: virtual std::unique_ptr getObject(const Module* M) = 0; }; -} +} // end namespace llvm -#endif +#endif // LLVM_EXECUTIONENGINE_OBJECTCACHE_H diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h index 148b115..aa09647 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h @@ -15,15 +15,35 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_COMPILEONDEMANDLAYER_H #define LLVM_EXECUTIONENGINE_ORC_COMPILEONDEMANDLAYER_H -#include "IndirectionUtils.h" -#include "LambdaResolver.h" +#include "llvm/ADT/APInt.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Debug.h" -#include "llvm/Transforms/Utils/Cloning.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Twine.h" +#include "llvm/ExecutionEngine/JITSymbol.h" +#include "llvm/ExecutionEngine/RuntimeDyld.h" +#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h" +#include "llvm/ExecutionEngine/Orc/LambdaResolver.h" +#include "llvm/IR/Attributes.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DataLayout.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/GlobalAlias.h" +#include "llvm/IR/GlobalValue.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Mangler.h" +#include "llvm/IR/Module.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include +#include #include #include #include +#include #include +#include namespace llvm { namespace orc { @@ -40,11 +60,11 @@ template class CompileOnDemandLayer { private: - template class LambdaMaterializer final : public ValueMaterializer { public: LambdaMaterializer(MaterializerFtor M) : M(std::move(M)) {} + Value *materialize(Value *V) final { return M(V); } private: @@ -66,7 +86,8 @@ private: ResourceOwner() = default; ResourceOwner(const ResourceOwner&) = delete; ResourceOwner& operator=(const ResourceOwner&) = delete; - virtual ~ResourceOwner() { } + virtual ~ResourceOwner() = default; + virtual ResourceT& getResource() const = 0; }; @@ -75,7 +96,9 @@ private: public: ResourceOwnerImpl(ResourcePtrT ResourcePtr) : ResourcePtr(std::move(ResourcePtr)) {} + ResourceT& getResource() const override { return *ResourcePtr; } + private: ResourcePtrT ResourcePtr; }; @@ -161,7 +184,6 @@ private: typedef std::list LogicalDylibList; public: - /// @brief Handle to a set of loaded modules. typedef typename LogicalDylibList::iterator ModuleSetHandleT; @@ -258,9 +280,8 @@ public: if (auto LMResources = LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) { Module &SrcM = LMResources->SourceModule->getResource(); std::string CalledFnName = mangle(FuncName, SrcM.getDataLayout()); - if (auto EC = LMResources->StubsMgr->updatePointer(CalledFnName, FnBodyAddr)) { + if (auto EC = LMResources->StubsMgr->updatePointer(CalledFnName, FnBodyAddr)) return false; - } else return true; } @@ -269,7 +290,6 @@ public: } private: - template void addLogicalModule(LogicalDylib &LD, ModulePtrT SrcMPtr) { @@ -547,7 +567,7 @@ private: bool CloneStubsIntoPartitions; }; -} // End namespace orc. -} // End namespace llvm. +} // end namespace orc +} // end namespace llvm #endif // LLVM_EXECUTIONENGINE_ORC_COMPILEONDEMANDLAYER_H diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h index 6b38a24..07bbd92 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h @@ -14,14 +14,26 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_INDIRECTIONUTILS_H #define LLVM_EXECUTIONENGINE_ORC_INDIRECTIONUTILS_H -#include "LambdaResolver.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Twine.h" #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Mangler.h" #include "llvm/IR/Module.h" +#include "llvm/Support/Error.h" +#include "llvm/Support/Memory.h" #include "llvm/Support/Process.h" #include "llvm/Transforms/Utils/ValueMapper.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace llvm { namespace orc { @@ -55,7 +67,7 @@ public: JITCompileCallbackManager(JITTargetAddress ErrorHandlerAddress) : ErrorHandlerAddress(ErrorHandlerAddress) {} - virtual ~JITCompileCallbackManager() {} + virtual ~JITCompileCallbackManager() = default; /// @brief Execute the callback for the given trampoline id. Called by the JIT /// to compile functions on demand. @@ -210,7 +222,7 @@ public: /// @brief Map type for initializing the manager. See init. typedef StringMap> StubInitsMap; - virtual ~IndirectStubsManager() {} + virtual ~IndirectStubsManager() = default; /// @brief Create a single stub with the given name, target address and flags. virtual Error createStub(StringRef StubName, JITTargetAddress StubAddr, @@ -419,7 +431,7 @@ GlobalAlias *cloneGlobalAliasDecl(Module &Dst, const GlobalAlias &OrigA, void cloneModuleFlagsMetadata(Module &Dst, const Module &Src, ValueToValueMapTy &VMap); -} // End namespace orc. -} // End namespace llvm. +} // end namespace orc +} // end namespace llvm #endif // LLVM_EXECUTIONENGINE_ORC_INDIRECTIONUTILS_H diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h index f4f75c7..53d4c0c 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h @@ -14,14 +14,20 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_LAZYEMITTINGLAYER_H #define LLVM_EXECUTIONENGINE_ORC_LAZYEMITTINGLAYER_H +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/JITSymbol.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/Mangler.h" #include "llvm/IR/Module.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringMap.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" +#include +#include #include +#include +#include namespace llvm { namespace orc { @@ -39,8 +45,8 @@ public: private: class EmissionDeferredSet { public: - EmissionDeferredSet() : EmitState(NotEmitted) {} - virtual ~EmissionDeferredSet() {} + EmissionDeferredSet() = default; + virtual ~EmissionDeferredSet() = default; JITSymbol find(StringRef Name, bool ExportedSymbolsOnly, BaseLayerT &B) { switch (EmitState) { @@ -106,7 +112,7 @@ private: virtual BaseLayerHandleT emitToBaseLayer(BaseLayerT &BaseLayer) = 0; private: - enum { NotEmitted, Emitting, Emitted } EmitState; + enum { NotEmitted, Emitting, Emitted } EmitState = NotEmitted; BaseLayerHandleT Handle; }; @@ -121,7 +127,6 @@ private: Resolver(std::move(Resolver)) {} protected: - const GlobalValue* searchGVs(StringRef Name, bool ExportedSymbolsOnly) const override { // FIXME: We could clean all this up if we had a way to reliably demangle @@ -277,7 +282,6 @@ public: void emitAndFinalize(ModuleSetHandleT H) { (*H)->emitAndFinalize(BaseLayer); } - }; template @@ -293,7 +297,7 @@ LazyEmittingLayer::EmissionDeferredSet::create( std::move(Resolver)); } -} // End namespace orc. -} // End namespace llvm. +} // end namespace orc +} // end namespace llvm #endif // LLVM_EXECUTIONENGINE_ORC_LAZYEMITTINGLAYER_H diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h index 578ec55..0588d22 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h @@ -15,11 +15,22 @@ #define LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" +#include "llvm/ExecutionEngine/RuntimeDyld.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" +#include "llvm/Object/ObjectFile.h" +#include "llvm/Support/Error.h" +#include +#include +#include #include #include +#include +#include +#include namespace llvm { namespace orc { @@ -34,11 +45,11 @@ protected: /// had been provided by this instance. Higher level layers are responsible /// for taking any action required to handle the missing symbols. class LinkedObjectSet { - LinkedObjectSet(const LinkedObjectSet&) = delete; - void operator=(const LinkedObjectSet&) = delete; public: LinkedObjectSet() = default; - virtual ~LinkedObjectSet() {} + LinkedObjectSet(const LinkedObjectSet&) = delete; + void operator=(const LinkedObjectSet&) = delete; + virtual ~LinkedObjectSet() = default; virtual void finalize() = 0; @@ -59,6 +70,7 @@ protected: SymEntry->second.getFlags()); return JITSymbol(SymEntry->second); } + protected: StringMap SymbolTable; bool Finalized = false; @@ -71,7 +83,6 @@ public: typedef LinkedObjectSetListT::iterator ObjSetHandleT; }; - /// @brief Default (no-op) action to perform when loading objects. class DoNothingOnNotifyLoaded { public: @@ -89,12 +100,10 @@ public: template class ObjectLinkingLayer : public ObjectLinkingLayerBase { public: - /// @brief Functor for receiving finalization notifications. typedef std::function NotifyFinalizedFtor; private: - template class ConcreteLinkedObjectSet : public LinkedObjectSet { @@ -151,7 +160,6 @@ private: } private: - void buildInitialSymbolTable(const ObjSetT &Objects) { for (const auto &Obj : Objects) for (auto &Symbol : getObject(*Obj).symbols()) { @@ -212,7 +220,6 @@ private: } public: - /// @brief LoadedObjectInfo list. Contains a list of owning pointers to /// RuntimeDyld::LoadedObjectInfo instances. typedef std::vector> @@ -248,7 +255,6 @@ public: ObjSetHandleT addObjectSet(ObjSetT Objects, MemoryManagerPtrT MemMgr, SymbolResolverPtrT Resolver) { - auto Finalizer = [&](ObjSetHandleT H, RuntimeDyld &RTDyld, const ObjSetT &Objs, std::function LOSHandleLoad) { @@ -334,7 +340,6 @@ public: } private: - static const object::ObjectFile& getObject(const object::ObjectFile &Obj) { return Obj; } @@ -351,7 +356,7 @@ private: bool ProcessAllSections; }; -} // End namespace orc. -} // End namespace llvm +} // end namespace orc +} // end namespace llvm #endif // LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H diff --git a/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h b/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h index 3fc962f..5638717 100644 --- a/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h +++ b/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h @@ -14,22 +14,24 @@ #ifndef LLVM_EXECUTIONENGINE_RTDYLDMEMORYMANAGER_H #define LLVM_EXECUTIONENGINE_RTDYLDMEMORYMANAGER_H -#include "RuntimeDyld.h" -#include "llvm-c/ExecutionEngine.h" +#include "llvm/ExecutionEngine/JITSymbol.h" +#include "llvm/ExecutionEngine/RuntimeDyld.h" #include "llvm/Support/CBindingWrapping.h" -#include "llvm/Support/Memory.h" +#include "llvm-c/ExecutionEngine.h" +#include +#include +#include namespace llvm { class ExecutionEngine; - namespace object { - class ObjectFile; - } +namespace object { + class ObjectFile; +} // end namespace object class MCJITMemoryManager : public RuntimeDyld::MemoryManager { public: - // Don't hide the notifyObjectLoaded method from RuntimeDyld::MemoryManager. using RuntimeDyld::MemoryManager::notifyObjectLoaded; @@ -55,10 +57,10 @@ public: // for the varying types of objects to be allocated. class RTDyldMemoryManager : public MCJITMemoryManager, public JITSymbolResolver { +public: + RTDyldMemoryManager() = default; RTDyldMemoryManager(const RTDyldMemoryManager&) = delete; void operator=(const RTDyldMemoryManager&) = delete; -public: - RTDyldMemoryManager() {} ~RTDyldMemoryManager() override; /// Register EH frames in the current process. @@ -143,7 +145,6 @@ public: DEFINE_SIMPLE_CONVERSION_FUNCTIONS( RTDyldMemoryManager, LLVMMCJITMemoryManagerRef) -} // namespace llvm - +} // end namespace llvm -#endif +#endif // LLVM_EXECUTIONENGINE_RTDYLDMEMORYMANAGER_H diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h index 70df6ca..13a5f99 100644 --- a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h +++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h @@ -14,33 +14,39 @@ #ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H #define LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H -#include "JITSymbol.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/DIContext.h" +#include "llvm/ExecutionEngine/JITSymbol.h" #include "llvm/Object/ObjectFile.h" -#include "llvm/Support/Memory.h" +#include "llvm/Support/Error.h" +#include +#include +#include +#include #include #include -#include +#include +#include namespace llvm { -class StringRef; - namespace object { - class ObjectFile; template class OwningBinary; -} +} // end namespace object /// Base class for errors originating in RuntimeDyld, e.g. missing relocation /// support. class RuntimeDyldError : public ErrorInfo { public: static char ID; + RuntimeDyldError(std::string ErrMsg) : ErrMsg(std::move(ErrMsg)) {} + void log(raw_ostream &OS) const override; const std::string &getErrorMessage() const { return ErrMsg; } std::error_code convertToErrorCode() const override; + private: std::string ErrMsg; }; @@ -51,18 +57,16 @@ class RuntimeDyldCheckerImpl; class RuntimeDyld { friend class RuntimeDyldCheckerImpl; - RuntimeDyld(const RuntimeDyld &) = delete; - void operator=(const RuntimeDyld &) = delete; - protected: // Change the address associated with a section when resolving relocations. // Any relocations already associated with the symbol will be re-resolved. void reassignSectionAddress(unsigned SectionID, uint64_t Addr); -public: +public: /// \brief Information about the loaded object. class LoadedObjectInfo : public llvm::LoadedObjectInfo { friend class RuntimeDyldImpl; + public: typedef std::map ObjSectionToIDMap; @@ -91,6 +95,7 @@ public: LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, LoadedObjectInfo::ObjSectionToIDMap ObjSecToIDMap) : LoadedObjectInfo(RTDyld, std::move(ObjSecToIDMap)) {} + std::unique_ptr clone() const override { return llvm::make_unique(static_cast(*this)); } @@ -99,9 +104,10 @@ public: /// \brief Memory Management. class MemoryManager { friend class RuntimeDyld; + public: - MemoryManager() : FinalizationLocked(false) {} - virtual ~MemoryManager() {} + MemoryManager() = default; + virtual ~MemoryManager() = default; /// Allocate a memory block of (at least) the given size suitable for /// executable code. The SectionID is a unique identifier assigned by the @@ -174,11 +180,14 @@ public: private: virtual void anchor(); - bool FinalizationLocked; + + bool FinalizationLocked = false; }; /// \brief Construct a RuntimeDyld instance. RuntimeDyld(MemoryManager &MemMgr, JITSymbolResolver &Resolver); + RuntimeDyld(const RuntimeDyld &) = delete; + void operator=(const RuntimeDyld &) = delete; ~RuntimeDyld(); /// Add the referenced object file to the list of objects to be loaded and diff --git a/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h b/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h index 7bb96eb..3b2af11 100644 --- a/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h +++ b/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h @@ -16,11 +16,15 @@ #define LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" -#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Memory.h" +#include +#include +#include namespace llvm { + /// This is a simple memory manager which implements the methods called by /// the RuntimeDyld class to allocate memory for section-based loading of /// objects, usually those generated by the MCJIT execution engine. @@ -35,11 +39,10 @@ namespace llvm { /// MCJIT::finalizeObject or by calling SectionMemoryManager::finalizeMemory /// directly. Clients of MCJIT should call MCJIT::finalizeObject. class SectionMemoryManager : public RTDyldMemoryManager { +public: + SectionMemoryManager() = default; SectionMemoryManager(const SectionMemoryManager&) = delete; void operator=(const SectionMemoryManager&) = delete; - -public: - SectionMemoryManager() { } ~SectionMemoryManager() override; /// \brief Allocates a memory block of (at least) the given size suitable for @@ -118,6 +121,6 @@ private: MemoryGroup RODataMem; }; -} +} // end namespace llvm #endif // LLVM_EXECUTION_ENGINE_SECTION_MEMORY_MANAGER_H -- 2.7.4