| 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 | // | 
|  | 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 Kleckner | d59e2fa | 2014-02-12 21:26:20 +0000 | [diff] [blame] | 14 | #include "WindowsSupport.h" | 
| NAKAMURA Takumi | ea97a05 | 2011-10-15 04:29:36 +0000 | [diff] [blame] | 15 | #include <cstdio> | 
|  | 16 | #include <string> | 
| Daniel Dunbar | e52e6bf | 2008-10-02 01:17:28 +0000 | [diff] [blame] | 17 |  | 
|  | 18 | using namespace llvm; | 
|  | 19 |  | 
| Alex Lorenz | 215be39 | 2017-07-07 10:08:52 +0000 | [diff] [blame] | 20 | static std::string updateTripleOSVersion(std::string Triple) { | 
|  | 21 | return Triple; | 
| Alex Lorenz | 3803df3 | 2017-07-07 09:53:47 +0000 | [diff] [blame] | 22 | } | 
|  | 23 |  | 
| Sebastian Pop | 94441fb | 2011-11-01 21:32:20 +0000 | [diff] [blame] | 24 | std::string sys::getDefaultTargetTriple() { | 
| NAKAMURA Takumi | fc7f3b7 | 2017-06-17 03:19:08 +0000 | [diff] [blame] | 25 | 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 Dunbar | e52e6bf | 2008-10-02 01:17:28 +0000 | [diff] [blame] | 34 | } |