]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Driver/DarwinSDKInfo.h
Merge clang trunk r351319, resolve conflicts, and update FREEBSD-Xlist.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Driver / DarwinSDKInfo.h
1 //===--- DarwinSDKInfo.h - SDK Information parser for darwin ----*- C++ -*-===//
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 #ifndef LLVM_CLANG_DRIVER_DARWIN_SDK_INFO_H
11 #define LLVM_CLANG_DRIVER_DARWIN_SDK_INFO_H
12
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/Support/Error.h"
15 #include "llvm/Support/VersionTuple.h"
16 #include "llvm/Support/VirtualFileSystem.h"
17
18 namespace clang {
19 namespace driver {
20
21 /// The information about the darwin SDK that was used during this compilation.
22 class DarwinSDKInfo {
23 public:
24   DarwinSDKInfo(llvm::VersionTuple Version) : Version(Version) {}
25
26   const llvm::VersionTuple &getVersion() const { return Version; }
27
28 private:
29   llvm::VersionTuple Version;
30 };
31
32 /// Parse the SDK information from the SDKSettings.json file.
33 ///
34 /// \returns an error if the SDKSettings.json file is invalid, None if the
35 /// SDK has no SDKSettings.json, or a valid \c DarwinSDKInfo otherwise.
36 Expected<Optional<DarwinSDKInfo>> parseDarwinSDKInfo(llvm::vfs::FileSystem &VFS,
37                                                      StringRef SDKRootPath);
38
39 } // end namespace driver
40 } // end namespace clang
41
42 #endif // LLVM_CLANG_DRIVER_DARWIN_SDK_INFO_H