Skip to content

Instantly share code, notes, and snippets.

@knuxify
Created June 28, 2020 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knuxify/587eb95cf80e2e4945e9a17f1e1218c0 to your computer and use it in GitHub Desktop.
Save knuxify/587eb95cf80e2e4945e9a17f1e1218c0 to your computer and use it in GitHub Desktop.
From 2222b63c074a760f492f9580d64f4da30c72abc9 Mon Sep 17 00:00:00 2001
From: knuxify <knuxify@gmail.com>
Date: Sun, 28 Jun 2020 20:30:51 +0200
Subject: [PATCH] Don't depend on LLVM
---
src/Reactor/LLVMJIT.cpp | 56 ++++++++++++++--------------
src/Reactor/LLVMReactor.cpp | 16 ++++----
src/Reactor/LLVMReactor.hpp | 4 +-
src/Reactor/LLVMReactorDebugInfo.cpp | 10 ++---
src/Reactor/SubzeroReactor.cpp | 6 +--
tests/regres/cov/turbo-cov/main.cpp | 8 ++--
6 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/src/Reactor/LLVMJIT.cpp b/src/Reactor/LLVMJIT.cpp
index e4c812831..0200578dc 100644
--- a/src/Reactor/LLVMJIT.cpp
+++ b/src/Reactor/LLVMJIT.cpp
@@ -24,34 +24,34 @@ __pragma(warning(push))
__pragma(warning(disable : 4146)) // unary minus operator applied to unsigned type, result still unsigned
#endif
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/JITSymbol.h"
-#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
-#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
-#include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
-#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
-#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
-#include "llvm/ExecutionEngine/SectionMemoryManager.h"
-#include "llvm/IR/Constants.h"
-#include "llvm/IR/DataLayout.h"
-#include "llvm/IR/Function.h"
-#include "llvm/IR/GlobalVariable.h"
-#include "llvm/IR/LegacyPassManager.h"
-#include "llvm/IR/Mangler.h"
-#include "llvm/IR/Module.h"
-#include "llvm/IR/Verifier.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/Host.h"
-#include "llvm/Support/TargetSelect.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Transforms/Coroutines.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/IPO/PassManagerBuilder.h"
-#include "llvm/Transforms/InstCombine/InstCombine.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Scalar/GVN.h"
+#include <llvm10/llvm/Analysis/LoopPass.h>
+#include <llvm10/llvm/ExecutionEngine/ExecutionEngine.h>
+#include <llvm10/llvm/ExecutionEngine/JITSymbol.h>
+#include <llvm10/llvm/ExecutionEngine/Orc/CompileUtils.h>
+#include <llvm10/llvm/ExecutionEngine/Orc/IRCompileLayer.h>
+#include <llvm10/llvm/ExecutionEngine/Orc/LambdaResolver.h>
+#include <llvm10/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h>
+#include <llvm10/llvm/ExecutionEngine/RTDyldMemoryManager.h>
+#include <llvm10/llvm/ExecutionEngine/SectionMemoryManager.h>
+#include <llvm10/llvm/IR/Constants.h>
+#include <llvm10/llvm/IR/DataLayout.h>
+#include <llvm10/llvm/IR/Function.h>
+#include <llvm10/llvm/IR/GlobalVariable.h>
+#include <llvm10/llvm/IR/LegacyPassManager.h>
+#include <llvm10/llvm/IR/Mangler.h>
+#include <llvm10/llvm/IR/Module.h>
+#include <llvm10/llvm/IR/Verifier.h>
+#include <llvm10/llvm/Support/Compiler.h>
+#include <llvm10/llvm/Support/Error.h>
+#include <llvm10/llvm/Support/Host.h>
+#include <llvm10/llvm/Support/TargetSelect.h>
+#include <llvm10/llvm/Target/TargetOptions.h>
+#include <llvm10/llvm/Transforms/Coroutines.h>
+#include <llvm10/llvm/Transforms/IPO.h>
+#include <llvm10/llvm/Transforms/IPO/PassManagerBuilder.h>
+#include <llvm10/llvm/Transforms/InstCombine/InstCombine.h>
+#include <llvm10/llvm/Transforms/Scalar.h>
+#include <llvm10/llvm/Transforms/Scalar/GVN.h>
#ifdef _MSC_VER
__pragma(warning(pop))
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index fca41e4c1..f7fb09e18 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -22,18 +22,18 @@
#include "Reactor.hpp"
#include "x86.hpp"
-#include "llvm/IR/Intrinsics.h"
+#include <llvm10/llvm/IR/Intrinsics.h>
#if LLVM_VERSION_MAJOR >= 9
-# include "llvm/IR/IntrinsicsX86.h"
+# include <llvm10/llvm/IR/IntrinsicsX86.h>
#endif
#if LLVM_VERSION_MAJOR >= 10
-# include "llvm/Support/Alignment.h"
+# include <llvm10/llvm/Support/Alignment.h>
#endif
-#include "llvm/IR/LegacyPassManager.h"
-#include "llvm/IR/Verifier.h"
-#include "llvm/Transforms/Coroutines.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/Scalar.h"
+#include <llvm10/llvm/IR/LegacyPassManager.h>
+#include <llvm10/llvm/IR/Verifier.h>
+#include <llvm10/llvm/Transforms/Coroutines.h>
+#include <llvm10/llvm/Transforms/IPO.h>
+#include <llvm10/llvm/Transforms/Scalar.h>
#define ARGS(...) \
{ \
diff --git a/src/Reactor/LLVMReactor.hpp b/src/Reactor/LLVMReactor.hpp
index fc3f1a2a8..2f158714c 100644
--- a/src/Reactor/LLVMReactor.hpp
+++ b/src/Reactor/LLVMReactor.hpp
@@ -26,8 +26,8 @@ __pragma(warning(push))
__pragma(warning(disable : 4146)) // unary minus operator applied to unsigned type, result still unsigned
#endif
-#include "llvm/IR/IRBuilder.h"
-#include "llvm/IR/LLVMContext.h"
+#include "llvm10/llvm/IR/IRBuilder.h"
+#include "llvm10/llvm/IR/LLVMContext.h"
#ifdef _MSC_VER
__pragma(warning(pop))
diff --git a/src/Reactor/LLVMReactorDebugInfo.cpp b/src/Reactor/LLVMReactorDebugInfo.cpp
index 2a5e157e2..aa6bbd629 100644
--- a/src/Reactor/LLVMReactorDebugInfo.cpp
+++ b/src/Reactor/LLVMReactorDebugInfo.cpp
@@ -28,11 +28,11 @@ __pragma(warning(push))
__pragma(warning(disable : 4146)) // unary minus operator applied to unsigned type, result still unsigned
# endif
-# include "llvm/Demangle/Demangle.h"
-# include "llvm/ExecutionEngine/JITEventListener.h"
-# include "llvm/IR/DIBuilder.h"
-# include "llvm/IR/IRBuilder.h"
-# include "llvm/IR/Intrinsics.h"
+# include <llvm10/llvm/Demangle/Demangle.h>
+# include <llvm10/llvm/ExecutionEngine/JITEventListener.h>
+# include <llvm10/llvm/IR/DIBuilder.h>
+# include <llvm10/llvm/IR/IRBuilder.h>
+# include <llvm10/llvm/IR/Intrinsics.h>
# ifdef _MSC_VER
__pragma(warning(pop))
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp
index 1db826d3a..34a60d05c 100644
--- a/src/Reactor/SubzeroReactor.cpp
+++ b/src/Reactor/SubzeroReactor.cpp
@@ -29,9 +29,9 @@
#include "src/IceGlobalInits.h"
#include "src/IceTypes.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/raw_os_ostream.h"
+#include <llvm10/llvm/Support/Compiler.h>
+#include <llvm10/llvm/Support/FileSystem.h>
+#include <llvm10/llvm/Support/raw_os_ostream.h>
#include "marl/event.h"
diff --git a/tests/regres/cov/turbo-cov/main.cpp b/tests/regres/cov/turbo-cov/main.cpp
index 4aabd5cb1..853a626d5 100644
--- a/tests/regres/cov/turbo-cov/main.cpp
+++ b/tests/regres/cov/turbo-cov/main.cpp
@@ -16,10 +16,10 @@
// the per segment coverage in a binary stream. This avoids the overhead of
// encoding to JSON.
-#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/ProfileData/Coverage/CoverageMapping.h"
-#include "llvm/ProfileData/InstrProfReader.h"
+#include <llvm10/llvm/ADT/SmallString.h>
+#include <llvm10/llvm/ADT/StringRef.h>
+#include <llvm10/llvm/ProfileData/Coverage/CoverageMapping.h>
+#include <llvm10/llvm/ProfileData/InstrProfReader.h>
#include <cstdio>
--
2.27.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment