[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
Mon Dec 17 10:38:47 PST 2018
steven_wu added inline comments.
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);
> steven_wu wrote:
> > arphaman wrote:
> > > steven_wu wrote:
> > > > Isn't parseSDKSettings enough? And it can just return Optional<VersionTuple>?
> > > We will support other fields besides `VersionTuple` in the SDKSettings, so that's why we have a structure.
> > I feel like for this usage, it is better to return Expected<DarwinSDKInfo> with all the fields being Optional?
> Hmm, we want to assume that version exists for future uses. I feel like the current type captures the intention better.
I think it is fine for current use. We can always change in the future.
CHANGES SINCE LAST ACTION
More information about the cfe-commits