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.

54 lines
2.0 KiB

  1. //===- llvm/Codegen/LinkAllCodegenComponents.h ------------------*- 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 codegen related passes for tools like lli and
  11. // llc that need this functionality.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H
  15. #define LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H
  16. #include "llvm/CodeGen/GCs.h"
  17. #include "llvm/CodeGen/Passes.h"
  18. #include "llvm/CodeGen/SchedulerRegistry.h"
  19. #include "llvm/Target/TargetMachine.h"
  20. #include <cstdlib>
  21. namespace {
  22. struct ForceCodegenLinking {
  23. ForceCodegenLinking() {
  24. // We must reference the passes in such a way that compilers will not
  25. // delete it all as dead code, even with whole program optimization,
  26. // yet is effectively a NO-OP. As the compiler isn't smart enough
  27. // to know that getenv() never returns -1, this will do the job.
  28. if (std::getenv("bar") != (char*) -1)
  29. return;
  30. (void) llvm::createFastRegisterAllocator();
  31. (void) llvm::createBasicRegisterAllocator();
  32. (void) llvm::createGreedyRegisterAllocator();
  33. (void) llvm::createDefaultPBQPRegisterAllocator();
  34. llvm::linkOcamlGC();
  35. llvm::linkErlangGC();
  36. llvm::linkShadowStackGC();
  37. (void) llvm::createBURRListDAGScheduler(NULL, llvm::CodeGenOpt::Default);
  38. (void) llvm::createSourceListDAGScheduler(NULL,llvm::CodeGenOpt::Default);
  39. (void) llvm::createHybridListDAGScheduler(NULL,llvm::CodeGenOpt::Default);
  40. (void) llvm::createFastDAGScheduler(NULL, llvm::CodeGenOpt::Default);
  41. (void) llvm::createDefaultScheduler(NULL, llvm::CodeGenOpt::Default);
  42. (void) llvm::createVLIWDAGScheduler(NULL, llvm::CodeGenOpt::Default);
  43. }
  44. } ForceCodegenLinking; // Force link by creating a global definition.
  45. }
  46. #endif