blob: 90a6fb316703f3755dd02974f4cae968743a2ec9 [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//
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 file implements the Win32 Host support.
11//
12//===----------------------------------------------------------------------===//
13
Reid Klecknerd59e2fa2014-02-12 21:26:20 +000014#include "WindowsSupport.h"
NAKAMURA Takumiea97a052011-10-15 04:29:36 +000015#include <cstdio>
16#include <string>
Daniel Dunbare52e6bf2008-10-02 01:17:28 +000017
18using namespace llvm;
19
Alex Lorenz215be392017-07-07 10:08:52 +000020static std::string updateTripleOSVersion(std::string Triple) {
21 return Triple;
Alex Lorenz3803df32017-07-07 09:53:47 +000022}
23
Sebastian Pop94441fb2011-11-01 21:32:20 +000024std::string sys::getDefaultTargetTriple() {
NAKAMURA Takumifc7f3b72017-06-17 03:19:08 +000025 const char *Triple = LLVM_DEFAULT_TARGET_TRIPLE;
26
27 // Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV.
28#if defined(LLVM_TARGET_TRIPLE_ENV)
29 if (const char *EnvTriple = std::getenv(LLVM_TARGET_TRIPLE_ENV))
30 Triple = EnvTriple;
31#endif
32
33 return Triple::normalize(Triple);
Daniel Dunbare52e6bf2008-10-02 01:17:28 +000034}