| NAKAMURA Takumi | f744ad4 | 2014-09-24 04:45:14 +0000 | [diff] [blame] | 1 | //===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===// |
| Daniel Dunbar | e52e6bf | 2008-10-02 01:17:28 +0000 | [diff] [blame] | 2 | // |
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
| Daniel Dunbar | e52e6bf | 2008-10-02 01:17:28 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file implements the Win32 Host support. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| Reid Kleckner | d59e2fa | 2014-02-12 21:26:20 +0000 | [diff] [blame] | 13 | #include "WindowsSupport.h" |
| NAKAMURA Takumi | ea97a05 | 2011-10-15 04:29:36 +0000 | [diff] [blame] | 14 | #include <cstdio> |
| 15 | #include <string> |
| Daniel Dunbar | e52e6bf | 2008-10-02 01:17:28 +0000 | [diff] [blame] | 16 | |
| 17 | using namespace llvm; |
| 18 | |
| Alex Lorenz | 215be39 | 2017-07-07 10:08:52 +0000 | [diff] [blame] | 19 | static std::string updateTripleOSVersion(std::string Triple) { |
| 20 | return Triple; |
| Alex Lorenz | 3803df3 | 2017-07-07 09:53:47 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| Sebastian Pop | 94441fb | 2011-11-01 21:32:20 +0000 | [diff] [blame] | 23 | std::string sys::getDefaultTargetTriple() { |
| NAKAMURA Takumi | fc7f3b7 | 2017-06-17 03:19:08 +0000 | [diff] [blame] | 24 | 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 Hosek | f92ca01 | 2018-05-25 20:39:37 +0000 | [diff] [blame] | 32 | return Triple; |
| Daniel Dunbar | e52e6bf | 2008-10-02 01:17:28 +0000 | [diff] [blame] | 33 | } |