ae1e1cd025bb6a412172b45fcec1f2e53ff96006
[oota-llvm.git] / include / llvm / LinkAllVMCore.h
1 //===- LinkAllVMCore.h - Reference All VMCore Code --------------*- C++ -*-===//
2 //
3 //                      The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Reid Spencer and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_LINKALLVMCORE_H
17 #define LLVM_LINKALLVMCORE_H
18
19 #include "llvm/System/IncludeFile.h"
20
21 #include "llvm/Module.h"
22 #include "llvm/Instructions.h"
23 #include "llvm/IntrinsicInst.h"
24 #include "llvm/InlineAsm.h"
25 #include "llvm/Analysis/Verifier.h"
26 #include "llvm/System/Alarm.h"
27 #include "llvm/System/DynamicLibrary.h"
28 #include "llvm/System/MappedFile.h"
29 #include "llvm/System/Memory.h"
30 #include "llvm/System/Mutex.h"
31 #include "llvm/System/Path.h"
32 #include "llvm/System/Process.h"
33 #include "llvm/System/Program.h"
34 #include "llvm/System/Signals.h"
35 #include "llvm/System/TimeValue.h"
36 #include "llvm/Support/Dwarf.h"
37 #include "llvm/Support/Mangler.h"
38 #include "llvm/Support/MathExtras.h"
39 #include "llvm/Support/SlowOperationInformer.h"
40
41 namespace {
42   struct ForceVMCoreLinking {
43     ForceVMCoreLinking() {
44       // We must reference VMCore in such a way that compilers will not
45       // delete it all as dead code, even with whole program optimization,
46       // yet is effectively a NO-OP. As the compiler isn't smart enough
47       // to know that getenv() never returns -1, this will do the job.
48       if (std::getenv("bar") != (char*) -1)
49         return;
50       (void)new llvm::Module("");
51       (void)new llvm::UnreachableInst();
52       (void)    llvm::createVerifierPass(); 
53     }
54   } ForceVMCoreLinking;
55 }
56
57 #endif