LLVM
22.0.0git
include
llvm
LinkAllIR.h
Go to the documentation of this file.
1
//===----- LinkAllIR.h - Reference All VMCore Code --------------*- 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 header file pulls in all the object modules of the VMCore library so
10
// that tools like llc, opt, and lli can ensure they are linked with all symbols
11
// from libVMCore.a It should only be used from a tool's main program.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_LINKALLIR_H
16
#define LLVM_LINKALLIR_H
17
18
#include "
llvm/BinaryFormat/Dwarf.h
"
19
#include "
llvm/IR/InlineAsm.h
"
20
#include "
llvm/IR/Instructions.h
"
21
#include "
llvm/IR/LLVMContext.h
"
22
#include "
llvm/IR/Module.h
"
23
#include "
llvm/IR/Verifier.h
"
24
#include "
llvm/Support/AlwaysTrue.h
"
25
#include "
llvm/Support/DynamicLibrary.h
"
26
#include "
llvm/Support/MathExtras.h
"
27
#include "
llvm/Support/Memory.h
"
28
#include "
llvm/Support/Mutex.h
"
29
#include "
llvm/Support/Path.h
"
30
#include "
llvm/Support/Process.h
"
31
#include "
llvm/Support/Program.h
"
32
#include "
llvm/Support/Signals.h
"
33
34
namespace
{
35
struct
ForceVMCoreLinking {
36
ForceVMCoreLinking() {
37
// We must reference VMCore in such a way that compilers will not
38
// delete it all as dead code, even with whole program optimization.
39
// This is so that globals in the translation units where these functions
40
// are defined are forced to be initialized, populating various
41
// registries.
42
if
(
llvm::getNonFoldableAlwaysTrue
())
43
return
;
44
llvm::LLVMContext
Context
;
45
(void)
new
llvm::Module(
""
,
Context
);
46
(void)
new
llvm::UnreachableInst(
Context
);
47
(void)
llvm::createVerifierPass
();
48
}
49
} ForceVMCoreLinking;
50
}
51
52
#endif
AlwaysTrue.h
Dwarf.h
This file contains constants used for implementing Dwarf debug support.
DynamicLibrary.h
Module.h
Module.h This file contains the declarations for the Module class.
InlineAsm.h
Instructions.h
LLVMContext.h
MathExtras.h
Context
@ Context
Definition
MemProfContextDisambiguation.cpp:124
Memory.h
Mutex.h
Path.h
Process.h
Provides a library for accessing information about this process and other processes on the operating ...
Program.h
Signals.h
Verifier.h
llvm::createVerifierPass
LLVM_ABI FunctionPass * createVerifierPass(bool FatalErrors=true)
Definition
Verifier.cpp:8031
llvm::getNonFoldableAlwaysTrue
bool getNonFoldableAlwaysTrue()
Definition
AlwaysTrue.h:15
Generated on
for LLVM by
1.14.0