瀏覽代碼

[linux-port] Handling of target triple. (#1359)

Ehsan 7 年之前
父節點
當前提交
0f4f2e5946
共有 2 個文件被更改,包括 9 次插入6 次删除
  1. 6 1
      include/llvm/Support/Host.h
  2. 3 5
      lib/Support/Windows/Host.inc

+ 6 - 1
include/llvm/Support/Host.h

@@ -44,8 +44,13 @@ namespace sys {
   ///   CPU_TYPE-VENDOR-OPERATING_SYSTEM
   /// or
   ///   CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
-  // std::string getDefaultTargetTriple(); // HLSL Change - single triple supported, no allocation required
+
+  // HLSL Change - single triple supported, no allocation required
+#ifdef _WIN32
   const char *getDefaultTargetTriple();
+#else
+  std::string getDefaultTargetTriple();
+#endif
 
   /// getProcessTriple() - Return an appropriate target triple for generating
   /// code to be loaded into the current process, e.g. when using the JIT.

+ 3 - 5
lib/Support/Windows/Host.inc

@@ -18,13 +18,11 @@
 using namespace llvm;
 
 // HLSL Change Starts - this is a fixed static char array now.
-#if 0
+#if _WIN32
+const char *sys::getDefaultTargetTriple() { return "dxil-ms-dx"; }
+#else
 std::string sys::getDefaultTargetTriple() {
   return Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE);
 }
-#else
-const char *sys::getDefaultTargetTriple() {
-  return "dxil-ms-dx";
-}
 #endif
 // HLSL Change Ends - this is a fixed static char array now.