aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2020-11-30 23:54:08 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2020-12-01 19:01:06 +0000
commit4eaa024863f4a86151beb7971301c6ab10a9de01 (patch)
tree81ee995d6d5d323f1f587abc2968ebaa8efdcf94
parentArgument dependent lookup with class argument is recursing into base (diff)
downloadllvm-project-4eaa024863f4a86151beb7971301c6ab10a9de01.tar.gz
llvm-project-4eaa024863f4a86151beb7971301c6ab10a9de01.tar.bz2
llvm-project-4eaa024863f4a86151beb7971301c6ab10a9de01.zip
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.
-rw-r--r--clang/include/clang/APINotes/Types.h14
-rw-r--r--clang/lib/APINotes/APINotesTypes.cpp26
2 files changed, 20 insertions, 20 deletions
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 3095bfbf1718..d9bf2f07291f 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -105,7 +105,7 @@ public:
return *this;
}
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const CommonEntityInfo &LHS,
@@ -176,7 +176,7 @@ public:
return *this;
}
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
@@ -338,7 +338,7 @@ public:
return *this;
}
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const VariableInfo &LHS, const VariableInfo &RHS) {
@@ -394,7 +394,7 @@ public:
return *this;
}
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const ObjCPropertyInfo &LHS,
@@ -464,7 +464,7 @@ public:
friend bool operator==(const ParamInfo &, const ParamInfo &);
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const ParamInfo &LHS, const ParamInfo &RHS) {
@@ -582,7 +582,7 @@ private:
}
public:
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const FunctionInfo &LHS, const FunctionInfo &RHS) {
@@ -717,7 +717,7 @@ public:
friend bool operator==(const TypedefInfo &, const TypedefInfo &);
- LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS);
+ LLVM_DUMP_METHOD void dump(llvm::raw_ostream &OS) const;
};
inline bool operator==(const TypedefInfo &LHS, const TypedefInfo &RHS) {
diff --git a/clang/lib/APINotes/APINotesTypes.cpp b/clang/lib/APINotes/APINotesTypes.cpp
index f443d90effb3..3d50ea96f144 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';