aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2023-05-08 13:07:11 +0200
committerSam McCall <sam.mccall@gmail.com>2023-05-08 13:07:11 +0200
commit14f0776550b5a49e1c42f49a00213f7f3fa047bf (patch)
tree61008e62ee9355dc4f54966bb66709274963c4ad /clang/lib/Basic/IdentifierTable.cpp
parent77bc5cc658a3b57a1fffbcb0490988ce7047d5b9 (diff)
downloadllvm-14f0776550b5a49e1c42f49a00213f7f3fa047bf.zip
llvm-14f0776550b5a49e1c42f49a00213f7f3fa047bf.tar.gz
llvm-14f0776550b5a49e1c42f49a00213f7f3fa047bf.tar.bz2
Reland "Give NullabilityKind a printing operator<<"
This reverts commit 5326c9e480d70e16c2504cb5143524aff3ee2605. The problem that caused the revert was downstream (missing dep in user of clang).
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 97dc5cd..9be42c0 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -849,6 +849,20 @@ StringRef clang::getNullabilitySpelling(NullabilityKind kind,
llvm_unreachable("Unknown nullability kind.");
}
+llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, NullabilityKind NK) {
+ switch (NK) {
+ case NullabilityKind::NonNull:
+ return OS << "NonNull";
+ case NullabilityKind::Nullable:
+ return OS << "Nullable";
+ case NullabilityKind::NullableResult:
+ return OS << "NullableResult";
+ case NullabilityKind::Unspecified:
+ return OS << "Unspecified";
+ }
+ llvm_unreachable("Unknown nullability kind.");
+}
+
diag::kind
IdentifierTable::getFutureCompatDiagKind(const IdentifierInfo &II,
const LangOptions &LangOpts) {