Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.9 KiB

  1. //===----- LinkAllIR.h - Reference All VMCore Code --------------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // 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. #ifndef LLVM_LINKALLIR_H
  16. #define LLVM_LINKALLIR_H
  17. #include "llvm/Analysis/Verifier.h"
  18. #include "llvm/IR/InlineAsm.h"
  19. #include "llvm/IR/Instructions.h"
  20. #include "llvm/IR/IntrinsicInst.h"
  21. #include "llvm/IR/LLVMContext.h"
  22. #include "llvm/IR/Module.h"
  23. #include "llvm/Support/Dwarf.h"
  24. #include "llvm/Support/DynamicLibrary.h"
  25. #include "llvm/Support/MathExtras.h"
  26. #include "llvm/Support/Memory.h"
  27. #include "llvm/Support/Mutex.h"
  28. #include "llvm/Support/Path.h"
  29. #include "llvm/Support/Process.h"
  30. #include "llvm/Support/Program.h"
  31. #include "llvm/Support/Signals.h"
  32. #include "llvm/Support/TimeValue.h"
  33. #include <cstdlib>
  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. // yet is effectively a NO-OP. As the compiler isn't smart enough
  40. // to know that getenv() never returns -1, this will do the job.
  41. if (std::getenv("bar") != (char*) -1)
  42. return;
  43. (void)new llvm::Module("", llvm::getGlobalContext());
  44. (void)new llvm::UnreachableInst(llvm::getGlobalContext());
  45. (void) llvm::createVerifierPass();
  46. }
  47. } ForceVMCoreLinking;
  48. }
  49. #endif