Port SwiftShader to LLVM 7.0
Change-Id: I89601ef9e42e56cfaeb1cd5ece4daa3f32b39950
Reviewed-on: https://swiftshader-review.googlesource.com/20475
Tested-by: Logan Chien <loganchien@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/LLVMRoutine.hpp b/src/Reactor/LLVMRoutine.hpp
index 264990f..0e70245 100644
--- a/src/Reactor/LLVMRoutine.hpp
+++ b/src/Reactor/LLVMRoutine.hpp
@@ -17,8 +17,11 @@
#include "Routine.hpp"
+#include <cstdint>
+
namespace sw
{
+#if SWIFTSHADER_LLVM_VERSION < 7
class LLVMRoutineManager;
class LLVMRoutine : public Routine
@@ -48,6 +51,32 @@
//const bool dynamic; // Generated or precompiled
};
+#else
+ class LLVMReactorJIT;
+
+ class LLVMRoutine : public Routine
+ {
+ public:
+ LLVMRoutine(void *ent, void (*callback)(LLVMReactorJIT *, uint64_t),
+ LLVMReactorJIT *jit, uint64_t key)
+ : entry(ent), dtor(callback), reactorJIT(jit), moduleKey(key)
+ { }
+
+ virtual ~LLVMRoutine();
+
+ const void *getEntry()
+ {
+ return entry;
+ }
+
+ private:
+ const void *entry;
+
+ void (*dtor)(LLVMReactorJIT *, uint64_t);
+ LLVMReactorJIT *reactorJIT;
+ uint64_t moduleKey;
+ };
+#endif // SWIFTSHADER_LLVM_VERSION < 7
}
#endif // sw_LLVMRoutine_hpp