LLVM
22.0.0git
include
llvm
ExecutionEngine
MCJIT.h
Go to the documentation of this file.
1
//===-- MCJIT.h - MC-Based Just-In-Time Execution Engine --------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file forces the MCJIT to link in on certain operating systems.
10
// (Windows).
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_EXECUTIONENGINE_MCJIT_H
15
#define LLVM_EXECUTIONENGINE_MCJIT_H
16
17
#include "
llvm/ExecutionEngine/ExecutionEngine.h
"
18
#include "
llvm/Support/AlwaysTrue.h
"
19
#include "
llvm/Support/Compiler.h
"
20
21
extern
"C"
LLVM_ABI
void
LLVMLinkInMCJIT
();
22
23
namespace
{
24
struct
ForceMCJITLinking {
25
ForceMCJITLinking() {
26
// We must reference MCJIT in such a way that compilers will not
27
// delete it all as dead code, even with whole program optimization, yet
28
// is effectively a NO-OP. This is so that globals in the translation
29
// units where these functions are defined are forced to be initialized,
30
// populating various registries.
31
if
(
llvm::getNonFoldableAlwaysTrue
())
32
return
;
33
34
LLVMLinkInMCJIT
();
35
}
36
} ForceMCJITLinking;
37
}
38
39
#endif
AlwaysTrue.h
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
LLVMLinkInMCJIT
LLVM_ABI void LLVMLinkInMCJIT()
Empty function used to force the linker to link MCJIT.
Definition
MCJIT.cpp:40
ExecutionEngine.h
llvm::getNonFoldableAlwaysTrue
bool getNonFoldableAlwaysTrue()
Definition
AlwaysTrue.h:15
Generated on
for LLVM by
1.14.0