LLVM API Documentation
00001 //===- LinkAllVMCore.h - Reference All VMCore Code --------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This header file pulls in all the object modules of the VMCore library so 00011 // that tools like llc, opt, and lli can ensure they are linked with all symbols 00012 // from libVMCore.a It should only be used from a tool's main program. 00013 // 00014 //===----------------------------------------------------------------------===// 00015 00016 #ifndef LLVM_LINKALLVMCORE_H 00017 #define LLVM_LINKALLVMCORE_H 00018 00019 #include "llvm/Module.h" 00020 #include "llvm/Instructions.h" 00021 #include "llvm/IntrinsicInst.h" 00022 #include "llvm/InlineAsm.h" 00023 #include "llvm/Analysis/Verifier.h" 00024 #include "llvm/System/Alarm.h" 00025 #include "llvm/System/DynamicLibrary.h" 00026 #include "llvm/System/Memory.h" 00027 #include "llvm/System/Mutex.h" 00028 #include "llvm/System/Path.h" 00029 #include "llvm/System/Process.h" 00030 #include "llvm/System/Program.h" 00031 #include "llvm/System/Signals.h" 00032 #include "llvm/System/TimeValue.h" 00033 #include "llvm/Support/Dwarf.h" 00034 #include "llvm/Support/Mangler.h" 00035 #include "llvm/Support/MathExtras.h" 00036 #include "llvm/Support/SlowOperationInformer.h" 00037 00038 namespace { 00039 struct ForceVMCoreLinking { 00040 ForceVMCoreLinking() { 00041 // We must reference VMCore in such a way that compilers will not 00042 // delete it all as dead code, even with whole program optimization, 00043 // yet is effectively a NO-OP. As the compiler isn't smart enough 00044 // to know that getenv() never returns -1, this will do the job. 00045 if (std::getenv("bar") != (char*) -1) 00046 return; 00047 llvm::Module* M = new llvm::Module(""); 00048 (void)new llvm::UnreachableInst(); 00049 (void) llvm::createVerifierPass(); 00050 (void) new llvm::Mangler(*M,""); 00051 } 00052 } ForceVMCoreLinking; 00053 } 00054 00055 #endif