Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
JitEngine.hpp
Go to the documentation of this file.
1//===-- JitEngine.hpp -- Base JIT Engine header --===//
2//
3// Part of the Proteus Project, under the Apache License v2.0 with LLVM
4// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef PROTEUS_JITENGINE_HPP
12#define PROTEUS_JITENGINE_HPP
13
14#include <cstdlib>
15#include <optional>
16#include <string>
17
18#include <llvm/ADT/DenseMap.h>
19#include <llvm/Demangle/Demangle.h>
20#include <llvm/IR/Module.h>
21#include <llvm/Target/TargetMachine.h>
22
24#include "proteus/Config.hpp"
25#include "proteus/CoreLLVM.hpp"
26#include "proteus/Debug.h"
27#include "proteus/Hashing.hpp"
28#include "proteus/Logger.hpp"
29
30namespace proteus {
31
32using namespace llvm;
33
34class JitEngine {
35public:
38
39 void enable() { Config::get().ProteusDisable = false; }
40
41 void disable() { Config::get().ProteusDisable = true; }
42
43protected:
44 SmallVector<RuntimeConstant>
45 getRuntimeConstantValues(void **KernelArgs,
46 ArrayRef<RuntimeConstantInfo *> RCInfoArray);
47
48 JitEngine();
49
50 std::string mangleSuffix(HashT &HashValue);
51};
52
53} // namespace proteus
54
55#endif
ArrayRef< RuntimeConstantInfo * > RCInfoArray
Definition CompilerInterfaceHost.cpp:25
bool ProteusDisable
Definition Config.hpp:123
static Config & get()
Definition Config.hpp:114
Definition Hashing.hpp:20
Definition JitEngine.hpp:34
JitEngine()
Definition JitEngine.cpp:29
bool isProteusDisabled()
Definition JitEngine.hpp:37
std::string mangleSuffix(HashT &HashValue)
Definition JitEngine.cpp:48
InitLLVMTargets Init
Definition JitEngine.hpp:36
SmallVector< RuntimeConstant > getRuntimeConstantValues(void **KernelArgs, ArrayRef< RuntimeConstantInfo * > RCInfoArray)
Definition JitEngine.cpp:205
void disable()
Definition JitEngine.hpp:41
void enable()
Definition JitEngine.hpp:39
Definition Helpers.h:76
Definition CppJitModule.cpp:21
Definition CoreLLVM.hpp:172