11#include "llvm/Config/llvm-config.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/Error.h"
16#include "llvm/Support/MemoryBuffer.h"
17#if LLVM_VERSION_MAJOR < 17
18#include "llvm/Support/Host.h"
20#include "llvm/TargetParser/Host.h"
22#include "llvm/Support/TargetSelect.h"
24#include "llvm/IR/DataLayout.h"
25#include "llvm/IR/LLVMContext.h"
26#include "llvm/IR/LegacyPassManager.h"
28#include "llvm/ExecutionEngine/Orc/LLJIT.h"
29#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
30#include "llvm/ExecutionEngine/Orc/Core.h"
31#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
32#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
33#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
34#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
35#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
36#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
37#include "llvm/ExecutionEngine/SectionMemoryManager.h"
38#if LLVM_VERSION_MAJOR < 12
39#include "llvm/ExecutionEngine/Orc/OrcABISupport.h"
40#include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
42#include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
45#include "llvm/Transforms/InstCombine/InstCombine.h"
46#include "llvm/Transforms/Scalar/GVN.h"
47#include "llvm/Transforms/Scalar.h"
49#include "clang/CodeGen/CodeGenAction.h"
50#include "clang/Basic/TargetInfo.h"
51#include "clang/Basic/FileManager.h"
52#include "clang/Frontend/CompilerInstance.h"
57#if LLVM_VERSION_MAJOR >= 11 && LLVM_VERSION_MAJOR <= 16
58using lookup_symbol_T = llvm::JITEvaluatedSymbol;
59#elif LLVM_VERSION_MAJOR >= 17 && LLVM_VERSION_MAJOR <= 20
60using lookup_symbol_T = llvm::orc::ExecutorSymbolDef;
62#warning "LLVM>=11 required."
65#if LLVM_VERSION_MAJOR >= 11 && LLVM_VERSION_MAJOR <= 18
66static constexpr auto tu_module_T{ clang::TranslationUnitKind::TU_Module };
67#elif LLVM_VERSION_MAJOR >= 19 && LLVM_VERSION_MAJOR <= 20
68static constexpr auto tu_module_T{ clang::TranslationUnitKind::TU_ClangModule };
70#warning "LLVM>=11 required."
75std::unique_ptr<llvm::MemoryBuffer>
get_virtual_source(llvm::StringRef code, clang::CompilerInstance &CI);
std::unique_ptr< llvm::MemoryBuffer > get_virtual_source(llvm::StringRef code, clang::CompilerInstance &CI)
void * get_function_ptr(const compat::lookup_symbol_T &func)
void createDiagnostics(clang::CompilerInstance &CI)
std::unique_ptr< llvm::orc::ExecutionSession > createExecutionSession()