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.

38 lines
1.1 KiB

  1. //===-- MCJIT.h - MC-Based Just-In-Time Execution Engine --------*- 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 file forces the MCJIT to link in on certain operating systems.
  11. // (Windows).
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_EXECUTIONENGINE_MCJIT_H
  15. #define LLVM_EXECUTIONENGINE_MCJIT_H
  16. #include "llvm/ExecutionEngine/ExecutionEngine.h"
  17. #include <cstdlib>
  18. extern "C" void LLVMLinkInMCJIT();
  19. namespace {
  20. struct ForceMCJITLinking {
  21. ForceMCJITLinking() {
  22. // We must reference MCJIT in such a way that compilers will not
  23. // delete it all as dead code, even with whole program optimization,
  24. // yet is effectively a NO-OP. As the compiler isn't smart enough
  25. // to know that getenv() never returns -1, this will do the job.
  26. if (std::getenv("bar") != (char*) -1)
  27. return;
  28. LLVMLinkInMCJIT();
  29. }
  30. } ForceMCJITLinking;
  31. }
  32. #endif