X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FExecutionEngine%2FOrc%2FJITSymbol.h;h=7c3ad56ab2d7aad9c0dba9aa93f92881f8d1dc81;hp=a670222c13206690d0786c9a2e42cc86b27ca201;hb=6d6178426fe90e3bc17f2647d458207e3758899b;hpb=376b96112618ee480c09d2fd0527254387e78486 diff --git a/include/llvm/ExecutionEngine/Orc/JITSymbol.h b/include/llvm/ExecutionEngine/Orc/JITSymbol.h index a670222c132..7c3ad56ab2d 100644 --- a/include/llvm/ExecutionEngine/Orc/JITSymbol.h +++ b/include/llvm/ExecutionEngine/Orc/JITSymbol.h @@ -14,6 +14,7 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_JITSYMBOL_H #define LLVM_EXECUTIONENGINE_ORC_JITSYMBOL_H +#include "llvm/ExecutionEngine/JITSymbolFlags.h" #include "llvm/Support/DataTypes.h" #include #include @@ -25,17 +26,19 @@ namespace orc { typedef uint64_t TargetAddress; /// @brief Represents a symbol in the JIT. -class JITSymbol { -public: +class JITSymbol : public JITSymbolBase { +public: + typedef std::function GetAddressFtor; /// @brief Create a 'null' symbol that represents failure to find a symbol /// definition. - JITSymbol(std::nullptr_t) : CachedAddr(0) {} + JITSymbol(std::nullptr_t) + : JITSymbolBase(JITSymbolFlags::None), CachedAddr(0) {} /// @brief Create a symbol for a definition with a known address. - JITSymbol(TargetAddress Addr) - : CachedAddr(Addr) {} + JITSymbol(TargetAddress Addr, JITSymbolFlags Flags) + : JITSymbolBase(Flags), CachedAddr(Addr) {} /// @brief Create a symbol for a definition that doesn't have a known address /// yet. @@ -46,8 +49,8 @@ public: /// definition without actually materializing the definition up front. The /// user can materialize the definition at any time by calling the getAddress /// method. - JITSymbol(GetAddressFtor GetAddress) - : CachedAddr(0), GetAddress(std::move(GetAddress)) {} + JITSymbol(GetAddressFtor GetAddress, JITSymbolFlags Flags) + : JITSymbolBase(Flags), GetAddress(std::move(GetAddress)), CachedAddr(0) {} /// @brief Returns true if the symbol exists, false otherwise. explicit operator bool() const { return CachedAddr || GetAddress; } @@ -64,8 +67,8 @@ public: } private: - TargetAddress CachedAddr; GetAddressFtor GetAddress; + TargetAddress CachedAddr; }; } // End namespace orc.