blob: 21b947f26df3eb0b7ad62c805391cc466612910f [file] [log] [blame]
NAKAMURA Takumif744ad42014-09-24 04:45:14 +00001//===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===//
Daniel Dunbare52e6bf2008-10-02 01:17:28 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Daniel Dunbare52e6bf2008-10-02 01:17:28 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the Win32 Host support.
10//
11//===----------------------------------------------------------------------===//
12
Reid Klecknerd59e2fa2014-02-12 21:26:20 +000013#include "WindowsSupport.h"
NAKAMURA Takumiea97a052011-10-15 04:29:36 +000014#include <cstdio>
15#include <string>
Daniel Dunbare52e6bf2008-10-02 01:17:28 +000016
17using namespace llvm;
18
Alex Lorenz215be392017-07-07 10:08:52 +000019static std::string updateTripleOSVersion(std::string Triple) {
20 return Triple;
Alex Lorenz3803df32017-07-07 09:53:47 +000021}
22
Sebastian Pop94441fb2011-11-01 21:32:20 +000023std::string sys::getDefaultTargetTriple() {
NAKAMURA Takumifc7f3b72017-06-17 03:19:08 +000024 const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE;
25
26 // Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV.
27#if defined(LLVM_TARGET_TRIPLE_ENV)
28 if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV))
29 Triple = EnvTriple;
30#endif
31
Petr Hosekf92ca012018-05-25 20:39:37 +000032 return Triple;
Daniel Dunbare52e6bf2008-10-02 01:17:28 +000033}