Make Reactor build stand-alone.

This is accomplished by duplicating files from the Common directory
that Reactor (both with LLVM and Subzero back-end) depended on. They
will be minimized in the next change.

Bug b/115344057
Bug swiftshader:16

Change-Id: I2dc087e91b761cc4402ed8594022551e9246b855
Reviewed-on: https://swiftshader-review.googlesource.com/c/20108
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index b702ec9..0f3b3da 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -14,6 +14,15 @@
 
 #include "Reactor.hpp"
 
+#include "x86.hpp"
+#include "CPUID.hpp"
+#include "Thread.hpp"
+#include "Memory.hpp"
+#include "MutexLock.hpp"
+
+#undef min
+#undef max
+
 #if SWIFTSHADER_LLVM_VERSION < 7
 	#include "llvm/Analysis/LoopPass.h"
 	#include "llvm/Constants.h"
@@ -69,12 +78,6 @@
 	#include <unordered_map>
 #endif
 
-#include "x86.hpp"
-#include "Common/CPUID.hpp"
-#include "Common/Thread.hpp"
-#include "Common/Memory.hpp"
-#include "Common/MutexLock.hpp"
-
 #include <numeric>
 #include <fstream>
 
@@ -120,7 +123,7 @@
 	llvm::Module *module = nullptr;
 	llvm::Function *function = nullptr;
 
-	sw::MutexLock codegenMutex;
+	rr::MutexLock codegenMutex;
 
 #if SWIFTSHADER_LLVM_VERSION >= 7
 	llvm::Value *lowerPAVG(llvm::Value *x, llvm::Value *y)
@@ -443,8 +446,6 @@
 
 namespace rr
 {
-	using namespace sw;
-
 #if SWIFTSHADER_LLVM_VERSION < 7
 	class LLVMReactorJIT
 	{