[PATCH] D12695: [Driver] Use UniversalCRT on Windows if available

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 09:02:39 PDT 2015


rnk added a subscriber: ruiu.
rnk added a comment.

FYI @ruiu is moving this code to LLVM in http://reviews.llvm.org/D12604.


================
Comment at: lib/Driver/MSVCToolChain.cpp:328-340
@@ +327,15 @@
+  llvm::sys::path::append(libPath, "Lib", ucrtVersion, "ucrt");
+  switch (getArch()) {
+  case llvm::Triple::x86:
+    llvm::sys::path::append(libPath, "x86");
+    break;
+  case llvm::Triple::x86_64:
+    llvm::sys::path::append(libPath, "x64");
+    break;
+  case llvm::Triple::arm:
+    llvm::sys::path::append(libPath, "arm");
+    break;
+  default:
+    return false;
+  }
+
----------------
Refactor this into a helper like `StringRef getWindowsSDKArch(llvm::Triple::Arch)` and share it with `getWindowsSDKLibraryPath`.

================
Comment at: lib/Driver/Tools.cpp:8956-8959
@@ -8955,1 +8955,6 @@
 
+    std::string UniversalCRTLibPath;
+    if (MSVC.getUniversalCRTLibraryPath(UniversalCRTLibPath))
+      CmdArgs.push_back(Args.MakeArgString(std::string("-libpath:") +
+                                           UniversalCRTLibPath.c_str()));
+
----------------
Does this have to be conditional on the version of the CRT in use? If I install VS 2013 and the ucrt and am trying to use the 2013 CRT, this will put both on the libpath. Is that a problem?


http://reviews.llvm.org/D12695





More information about the cfe-commits mailing list