diff options
Diffstat (limited to 'include/llvm/ExecutionEngine/Orc/ExecutionUtils.h')
-rw-r--r-- | include/llvm/ExecutionEngine/Orc/ExecutionUtils.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h b/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h index 71d847c06264..bf8cca406844 100644 --- a/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h +++ b/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h @@ -1,4 +1,4 @@ -//===-- ExecutionUtils.h - Utilities for executing code in Orc --*- C++ -*-===// +//===- ExecutionUtils.h - Utilities for executing code in Orc ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,8 +17,11 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/iterator_range.h" #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" +#include <algorithm> +#include <cstdint> +#include <string> #include <vector> +#include <utility> namespace llvm { @@ -37,7 +40,6 @@ namespace orc { /// getConstructors/getDestructors functions. class CtorDtorIterator { public: - /// @brief Accessor for an element of the global_ctors/global_dtors array. /// /// This class provides a read-only view of the element with any casts on @@ -89,17 +91,16 @@ iterator_range<CtorDtorIterator> getDestructors(const Module &M); template <typename JITLayerT> class CtorDtorRunner { public: - /// @brief Construct a CtorDtorRunner for the given range using the given /// name mangling function. CtorDtorRunner(std::vector<std::string> CtorDtorNames, - typename JITLayerT::ModuleSetHandleT H) + typename JITLayerT::ModuleHandleT H) : CtorDtorNames(std::move(CtorDtorNames)), H(H) {} /// @brief Run the recorded constructors/destructors through the given JIT /// layer. bool runViaLayer(JITLayerT &JITLayer) const { - typedef void (*CtorDtorTy)(); + using CtorDtorTy = void (*)(); bool Error = false; for (const auto &CtorDtorName : CtorDtorNames) @@ -115,7 +116,7 @@ public: private: std::vector<std::string> CtorDtorNames; - typename JITLayerT::ModuleSetHandleT H; + typename JITLayerT::ModuleHandleT H; }; /// @brief Support class for static dtor execution. For hosted (in-process) JITs @@ -135,7 +136,6 @@ private: /// called. class LocalCXXRuntimeOverrides { public: - /// Create a runtime-overrides class. template <typename MangleFtorT> LocalCXXRuntimeOverrides(const MangleFtorT &Mangle) { @@ -156,7 +156,6 @@ public: void runDestructors(); private: - template <typename PtrTy> JITTargetAddress toTargetAddress(PtrTy* P) { return static_cast<JITTargetAddress>(reinterpret_cast<uintptr_t>(P)); @@ -168,15 +167,16 @@ private: StringMap<JITTargetAddress> CXXRuntimeOverrides; - typedef void (*DestructorPtr)(void*); - typedef std::pair<DestructorPtr, void*> CXXDestructorDataPair; - typedef std::vector<CXXDestructorDataPair> CXXDestructorDataPairList; + using DestructorPtr = void (*)(void *); + using CXXDestructorDataPair = std::pair<DestructorPtr, void *>; + using CXXDestructorDataPairList = std::vector<CXXDestructorDataPair>; CXXDestructorDataPairList DSOHandleOverride; static int CXAAtExitOverride(DestructorPtr Destructor, void *Arg, void *DSOHandle); }; -} // End namespace orc. -} // End namespace llvm. +} // end namespace orc + +} // end namespace llvm #endif // LLVM_EXECUTIONENGINE_ORC_EXECUTIONUTILS_H |