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.3 KiB

  1. //===- llvm/Codegen/LinkAllAsmWriterComponents.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 assembler writer related passes for tools like
  11. // llc that need this functionality.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H
  15. #define LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H
  16. #include "llvm/CodeGen/GCs.h"
  17. #include <cstdlib>
  18. namespace {
  19. struct ForceAsmWriterLinking {
  20. ForceAsmWriterLinking() {
  21. // We must reference the plug-ins in such a way that compilers will not
  22. // delete it all as dead code, even with whole program optimization,
  23. // yet is effectively a NO-OP. As the compiler isn't smart enough
  24. // to know that getenv() never returns -1, this will do the job.
  25. if (std::getenv("bar") != (char*) -1)
  26. return;
  27. llvm::linkOcamlGCPrinter();
  28. llvm::linkErlangGCPrinter();
  29. }
  30. } ForceAsmWriterLinking; // Force link by creating a global definition.
  31. }
  32. #endif // LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H