mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
//===-- context.h - jit support ---------------------------------*- C++ -*-===//
|
||
//
|
||
// LDC – the LLVM D compiler
|
||
//
|
||
// This file is distributed under the Boost Software License. See the LICENSE
|
||
// file for details.
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
//
|
||
// Jit compilation context, must be in sync with runtimecompile.d.
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
#ifndef CONTEXT_H
|
||
#define CONTEXT_H
|
||
|
||
#include <cstddef> //size_t
|
||
|
||
enum class DumpStage : int {
|
||
OriginalModule = 0,
|
||
MergedModule = 1,
|
||
OptimizedModule = 2,
|
||
FinalAsm = 3
|
||
};
|
||
|
||
typedef void (*InterruptPointHandlerT)(void *, const char *action,
|
||
const char *object);
|
||
typedef void (*FatalHandlerT)(void *, const char *reason);
|
||
typedef void (*DumpHandlerT)(void *, DumpStage stage, const char *str,
|
||
std::size_t len);
|
||
|
||
struct Context final {
|
||
unsigned optLevel = 0;
|
||
unsigned sizeLevel = 0;
|
||
InterruptPointHandlerT interruptPointHandler = nullptr;
|
||
void *interruptPointHandlerData = nullptr;
|
||
FatalHandlerT fatalHandler = nullptr;
|
||
void *fatalHandlerData = nullptr;
|
||
DumpHandlerT dumpHandler = nullptr;
|
||
void *dumpHandlerData = nullptr;
|
||
};
|
||
|
||
#endif // CONTEXT_H
|