Host.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //===- llvm/TargetParser/Win32/Host.inc -------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file implements the Win32 Host support.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // We need to include config.h here because LLVM_DEFAULT_TARGET_TRIPLE is not
  13. // defined in llvm-config.h if it is unset.
  14. #include "llvm/Config/config.h"
  15. #include "llvm/Support/Windows/WindowsSupport.h"
  16. #include <cstdio>
  17. #include <string>
  18. using namespace llvm;
  19. static std::string updateTripleOSVersion(std::string Triple) { return Triple; }
  20. std::string sys::getDefaultTargetTriple() {
  21. const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE;
  22. // Override the default target with an environment variable named by
  23. // LLVM_TARGET_TRIPLE_ENV.
  24. #if defined(LLVM_TARGET_TRIPLE_ENV)
  25. if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV))
  26. Triple = EnvTriple;
  27. #endif
  28. return Triple;
  29. }