1//===- llvm/Support/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 13// We need to include config.h here because LLVM_DEFAULT_TARGET_TRIPLE is not 14// defined in llvm-config.h if it is unset. 15#include "llvm/Config/config.h" 16#include "llvm/Support/Windows/WindowsSupport.h" 17#include <cstdio> 18#include <string> 19 20using namespace llvm; 21 22static std::string updateTripleOSVersion(std::string Triple) { 23 return Triple; 24} 25 26std::string sys::getDefaultTargetTriple() { 27 const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE; 28 29 // Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV. 30#if defined(LLVM_TARGET_TRIPLE_ENV) 31 if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV)) 32 Triple = EnvTriple; 33#endif 34 35 return Triple; 36} 37