1 //===- LinkAllVMCore.h - Reference All VMCore Code --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header file pulls in all the object modules of the VMCore library so
11 // that tools like llc, opt, and lli can ensure they are linked with all symbols
12 // from libVMCore.a It should only be used from a tool's main program.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LINKALLVMCORE_H
17 #define LLVM_LINKALLVMCORE_H
19 #include "llvm/Module.h"
20 #include "llvm/Instructions.h"
21 #include "llvm/IntrinsicInst.h"
22 #include "llvm/InlineAsm.h"
23 #include "llvm/Analysis/Verifier.h"
24 #include "llvm/System/Alarm.h"
25 #include "llvm/System/DynamicLibrary.h"
26 #include "llvm/System/Memory.h"
27 #include "llvm/System/Mutex.h"
28 #include "llvm/System/Path.h"
29 #include "llvm/System/Process.h"
30 #include "llvm/System/Program.h"
31 #include "llvm/System/Signals.h"
32 #include "llvm/System/TimeValue.h"
33 #include "llvm/Support/Dwarf.h"
34 #include "llvm/Support/Mangler.h"
35 #include "llvm/Support/MathExtras.h"
36 #include "llvm/Support/SlowOperationInformer.h"
39 struct ForceVMCoreLinking {
40 ForceVMCoreLinking() {
41 // We must reference VMCore in such a way that compilers will not
42 // delete it all as dead code, even with whole program optimization,
43 // yet is effectively a NO-OP. As the compiler isn't smart enough
44 // to know that getenv() never returns -1, this will do the job.
45 if (std::getenv("bar") != (char*) -1)
47 llvm::Module* M = new llvm::Module("");
48 (void)new llvm::UnreachableInst();
49 (void) llvm::createVerifierPass();
50 (void) new llvm::Mangler(*M,"");