mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add ASTDumper support for AvailabilityQueryExpr
This patch also moves some static utility methods involving PlatformKind out of Attr.h and into PlatformKind.h. Swift SVN r21896
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//===--- PlatformKinds.h - Swift Language Platform Kinds --------*- C++ -*-===//
|
||||
//===--- PlatformKind.h - Swift Language Platform Kinds ---------*- C++ -*-===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
@@ -17,15 +17,31 @@
|
||||
#ifndef SWIFT_AST_PLATFORM_KIND_H
|
||||
#define SWIFT_AST_PLATFORM_KIND_H
|
||||
|
||||
#include "swift/Basic/LLVM.h"
|
||||
#include "swift/Basic/Optional.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
namespace swift {
|
||||
|
||||
/// Available platforms for the availability attribute.
|
||||
enum class PlatformKind {
|
||||
enum class PlatformKind {
|
||||
none,
|
||||
#define AVAILABILITY_PLATFORM(X, PrettyName) X,
|
||||
#include "swift/AST/PlatformKinds.def"
|
||||
};
|
||||
|
||||
/// Returns the short string representating the platform, suitable for
|
||||
/// use in availability specifications (e.g., "OSX").
|
||||
StringRef platformString(PlatformKind platform);
|
||||
|
||||
/// Returns the platform kind corresponding to the passed-in short platform name
|
||||
/// or Nothing if such a platform kind does not exist.
|
||||
Optional<PlatformKind> platformFromString(StringRef Name);
|
||||
|
||||
/// Returns a human-readiable version of the platform name as a string, suitable
|
||||
/// for emission in diagnostics (e.g., "OS X").
|
||||
StringRef prettyPlatformString(PlatformKind platform);
|
||||
|
||||
} // end namespace swift
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user