[PATCH] D55673: [darwin] parse the SDK settings from SDKSettings.json if it exists and pass in the -target-sdk-version to the compiler and backend

Steven Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 13 14:35:25 PST 2018


steven_wu added a comment.

See comments inline.



================
Comment at: include/clang/Driver/DarwinSDKInfo.h:1
+//===--- DarwinSDKInfo.h - SDK Information parser for darwin ----*- C++ -*-===//
+//
----------------
Can this just be in Toolchains/Darwin.h?


================
Comment at: include/clang/Driver/DarwinSDKInfo.h:36
+/// SDK has no SDKSettings.json, or a valid \c DarwinSDKInfo otherwise.
+Expected<Optional<DarwinSDKInfo>> parseDarwinSDKInfo(llvm::vfs::FileSystem &VFS,
+                                                     StringRef SDKRootPath);
----------------
Isn't parseSDKSettings enough? And it can just return Optional<VersionTuple>?


================
Comment at: lib/Driver/ToolChains/Darwin.cpp:2053
+    return None;
+  }
+  return *SDKInfoOrErr;
----------------
We also has this InferredFromSDK when we infer deployment target, which can be used as a fallback method.

The result of parsing JSON should be available to InferredFromSDK in deployment target setting.

Bonus point is to set "-sdk_version" flag passing to ld64.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55673/new/

https://reviews.llvm.org/D55673





More information about the cfe-commits mailing list