15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/VersionTuple.h"
17 #include "llvm/Support/raw_ostream.h"
21 using namespace clang;
26 llvm::raw_string_ostream Out(Result);
55 if (dash != StringRef::npos && dash + 1 != input.size() &&
56 (input[dash+1] <
'0' || input[dash+1] >
'9')) {
57 dash = StringRef::npos;
62 StringRef runtimeName = input.substr(0, dash);
63 Version = VersionTuple(0);
64 if (runtimeName ==
"macosx") {
66 }
else if (runtimeName ==
"macosx-fragile") {
68 }
else if (runtimeName ==
"ios") {
70 }
else if (runtimeName ==
"watchos") {
72 }
else if (runtimeName ==
"gnustep") {
75 Version = VersionTuple(1, 6);
77 }
else if (runtimeName ==
"gcc") {
79 }
else if (runtimeName ==
"objfw") {
81 Version = VersionTuple(0, 8);
87 if (dash != StringRef::npos) {
88 StringRef verString = input.substr(dash + 1);
89 if (Version.tryParse(verString))
94 Version = VersionTuple(0, 8);
Defines types useful for describing an Objective-C runtime.
The basic abstraction for the target Objective-C runtime.
const VersionTuple & getVersion() const
bool tryParse(StringRef input)
Try to parse an Objective-C runtime specification from the given string.
std::string getAsString() const
Kind
The basic Objective-C runtimes that we know about.
@ MacOSX
'macosx' is the Apple-provided NeXT-derived runtime on Mac OS X platforms that use the non-fragile AB...
@ FragileMacOSX
'macosx-fragile' is the Apple-provided NeXT-derived runtime on Mac OS X platforms that use the fragil...
@ GNUstep
'gnustep' is the modern non-fragile GNUstep runtime.
@ ObjFW
'objfw' is the Objective-C runtime included in ObjFW
@ iOS
'ios' is the Apple-provided NeXT-derived runtime on iOS or the iOS simulator; it is always non-fragil...
@ GCC
'gcc' is the Objective-C runtime shipped with GCC, implementing a fragile Objective-C ABI
@ WatchOS
'watchos' is a variant of iOS for Apple's watchOS.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
The JSON file list parser is used to communicate input to InstallAPI.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.