2014-09-24 12:45:14 +08:00
|
|
|
//===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===//
|
2008-10-02 09:17:28 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2008-10-02 09:17:28 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the Win32 Host support.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-02-28 16:59:24 +08:00
|
|
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
2011-10-15 12:29:36 +08:00
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
2008-10-02 09:17:28 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2017-07-07 18:08:52 +08:00
|
|
|
static std::string updateTripleOSVersion(std::string Triple) {
|
|
|
|
return Triple;
|
2017-07-07 17:53:47 +08:00
|
|
|
}
|
|
|
|
|
2011-11-02 05:32:20 +08:00
|
|
|
std::string sys::getDefaultTargetTriple() {
|
2017-06-17 11:19:08 +08:00
|
|
|
const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE;
|
|
|
|
|
|
|
|
// Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV.
|
|
|
|
#if defined(LLVM_TARGET_TRIPLE_ENV)
|
|
|
|
if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV))
|
|
|
|
Triple = EnvTriple;
|
|
|
|
#endif
|
|
|
|
|
2018-05-26 04:39:37 +08:00
|
|
|
return Triple;
|
2008-10-02 09:17:28 +08:00
|
|
|
}
|