diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2020-11-30 23:54:08 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2020-12-01 19:01:06 +0000 |
commit | 4eaa024863f4a86151beb7971301c6ab10a9de01 (patch) | |
tree | 81ee995d6d5d323f1f587abc2968ebaa8efdcf94 /clang/lib/APINotes | |
parent | 37340798ccb00b9c3a53e8a5f1b6430e85870338 (diff) | |
download | llvm-4eaa024863f4a86151beb7971301c6ab10a9de01.zip llvm-4eaa024863f4a86151beb7971301c6ab10a9de01.tar.gz llvm-4eaa024863f4a86151beb7971301c6ab10a9de01.tar.bz2 |
APINotes: constify `dump` methods (NFC)
This simply marks the functions as const as they do not mutate the
value. This is useful for debugging iterations during development.
NFCI.
Diffstat (limited to 'clang/lib/APINotes')
-rw-r--r-- | clang/lib/APINotes/APINotesTypes.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/clang/lib/APINotes/APINotesTypes.cpp b/clang/lib/APINotes/APINotesTypes.cpp index f443d90..3d50ea9 100644 --- a/clang/lib/APINotes/APINotesTypes.cpp +++ b/clang/lib/APINotes/APINotesTypes.cpp @@ -11,7 +11,7 @@ namespace clang { namespace api_notes { -void CommonEntityInfo::dump(llvm::raw_ostream &OS) { +void CommonEntityInfo::dump(llvm::raw_ostream &OS) const { if (Unavailable) OS << "[Unavailable] (" << UnavailableMsg << ")" << ' '; if (UnavailableInSwift) @@ -23,8 +23,8 @@ void CommonEntityInfo::dump(llvm::raw_ostream &OS) { OS << '\n'; } -void CommonTypeInfo::dump(llvm::raw_ostream &OS) { - static_cast<CommonEntityInfo &>(*this).dump(OS); +void CommonTypeInfo::dump(llvm::raw_ostream &OS) const { + static_cast<const CommonEntityInfo &>(*this).dump(OS); if (SwiftBridge) OS << "Swift Briged Type: " << *SwiftBridge << ' '; if (NSErrorDomain) @@ -45,8 +45,8 @@ void ObjCContextInfo::dump(llvm::raw_ostream &OS) { OS << '\n'; } -void VariableInfo::dump(llvm::raw_ostream &OS) { - static_cast<CommonEntityInfo &>(*this).dump(OS); +void VariableInfo::dump(llvm::raw_ostream &OS) const { + static_cast<const CommonEntityInfo &>(*this).dump(OS); if (NullabilityAudited) OS << "Audited Nullability: " << Nullable << ' '; if (!Type.empty()) @@ -54,23 +54,23 @@ void VariableInfo::dump(llvm::raw_ostream &OS) { OS << '\n'; } -void ObjCPropertyInfo::dump(llvm::raw_ostream &OS) { - static_cast<VariableInfo &>(*this).dump(OS); +void ObjCPropertyInfo::dump(llvm::raw_ostream &OS) const { + static_cast<const VariableInfo &>(*this).dump(OS); if (SwiftImportAsAccessorsSpecified) OS << (SwiftImportAsAccessors ? "[SwiftImportAsAccessors] " : ""); OS << '\n'; } -void ParamInfo::dump(llvm::raw_ostream &OS) { - static_cast<VariableInfo &>(*this).dump(OS); +void ParamInfo::dump(llvm::raw_ostream &OS) const { + static_cast<const VariableInfo &>(*this).dump(OS); if (NoEscapeSpecified) OS << (NoEscape ? "[NoEscape] " : ""); OS << "RawRetainCountConvention: " << RawRetainCountConvention << ' '; OS << '\n'; } -void FunctionInfo::dump(llvm::raw_ostream &OS) { - static_cast<CommonEntityInfo &>(*this).dump(OS); +void FunctionInfo::dump(llvm::raw_ostream &OS) const { + static_cast<const CommonEntityInfo &>(*this).dump(OS); OS << (NullabilityAudited ? "[NullabilityAudited] " : "") << "RawRetainCountConvention: " << RawRetainCountConvention << ' '; if (!ResultType.empty()) @@ -97,8 +97,8 @@ void TagInfo::dump(llvm::raw_ostream &OS) { OS << '\n'; } -void TypedefInfo::dump(llvm::raw_ostream &OS) { - static_cast<CommonTypeInfo &>(*this).dump(OS); +void TypedefInfo::dump(llvm::raw_ostream &OS) const { + static_cast<const CommonTypeInfo &>(*this).dump(OS); if (SwiftWrapper) OS << "Swift Type: " << static_cast<long>(*SwiftWrapper) << ' '; OS << '\n'; |