diff options
Diffstat (limited to 'include/clang/Basic/Specifiers.h')
-rw-r--r-- | include/clang/Basic/Specifiers.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h index 7569c16..5ce56c0 100644 --- a/include/clang/Basic/Specifiers.h +++ b/include/clang/Basic/Specifiers.h @@ -16,6 +16,9 @@ #ifndef LLVM_CLANG_BASIC_SPECIFIERS_H #define LLVM_CLANG_BASIC_SPECIFIERS_H +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/DataTypes.h" + namespace clang { /// \brief Specifies the width of a type, e.g., short, long, or long long. enum TypeSpecifierWidth { @@ -239,6 +242,22 @@ namespace clang { SD_Static, ///< Static storage duration. SD_Dynamic ///< Dynamic storage duration. }; + + /// Describes the nullability of a particular type. + enum class NullabilityKind : uint8_t { + /// Values of this type can never be null. + NonNull = 0, + /// Values of this type can be null. + Nullable, + /// Whether values of this type can be null is (explicitly) + /// unspecified. This captures a (fairly rare) case where we + /// can't conclude anything about the nullability of the type even + /// though it has been considered. + Unspecified + }; + + /// Retrieve the spelling of the given nullability kind. + llvm::StringRef getNullabilitySpelling(NullabilityKind kind); } // end namespace clang #endif // LLVM_CLANG_BASIC_SPECIFIERS_H |