@@ -7103,28 +7103,55 @@ inline const Type *Type::getPointeeOrArrayElementType() const {
7103
7103
return type->getBaseElementTypeUnsafe ();
7104
7104
return type;
7105
7105
}
7106
+ // / Insertion operator for diagnostics. This allows sending address spaces into
7107
+ // / a diagnostic with <<.
7108
+ inline const DiagnosticBuilder &operator <<(const DiagnosticBuilder &DB,
7109
+ LangAS AS) {
7110
+ DB.AddTaggedVal (static_cast <std::underlying_type_t <LangAS>>(AS),
7111
+ DiagnosticsEngine::ArgumentKind::ak_addrspace);
7112
+ return DB;
7113
+ }
7114
+
7106
7115
// / Insertion operator for partial diagnostics. This allows sending adress
7107
7116
// / spaces into a diagnostic with <<.
7108
- inline const StreamableDiagnosticBase &
7109
- operator <<( const StreamableDiagnosticBase &PD, LangAS AS) {
7117
+ inline const PartialDiagnostic & operator <<( const PartialDiagnostic &PD,
7118
+ LangAS AS) {
7110
7119
PD.AddTaggedVal (static_cast <std::underlying_type_t <LangAS>>(AS),
7111
7120
DiagnosticsEngine::ArgumentKind::ak_addrspace);
7112
7121
return PD;
7113
7122
}
7114
7123
7124
+ // / Insertion operator for diagnostics. This allows sending Qualifiers into a
7125
+ // / diagnostic with <<.
7126
+ inline const DiagnosticBuilder &operator <<(const DiagnosticBuilder &DB,
7127
+ Qualifiers Q) {
7128
+ DB.AddTaggedVal (Q.getAsOpaqueValue (),
7129
+ DiagnosticsEngine::ArgumentKind::ak_qual);
7130
+ return DB;
7131
+ }
7132
+
7115
7133
// / Insertion operator for partial diagnostics. This allows sending Qualifiers
7116
7134
// / into a diagnostic with <<.
7117
- inline const StreamableDiagnosticBase &
7118
- operator <<( const StreamableDiagnosticBase &PD, Qualifiers Q) {
7135
+ inline const PartialDiagnostic & operator <<( const PartialDiagnostic &PD,
7136
+ Qualifiers Q) {
7119
7137
PD.AddTaggedVal (Q.getAsOpaqueValue (),
7120
7138
DiagnosticsEngine::ArgumentKind::ak_qual);
7121
7139
return PD;
7122
7140
}
7123
7141
7142
+ // / Insertion operator for diagnostics. This allows sending QualType's into a
7143
+ // / diagnostic with <<.
7144
+ inline const DiagnosticBuilder &operator <<(const DiagnosticBuilder &DB,
7145
+ QualType T) {
7146
+ DB.AddTaggedVal (reinterpret_cast <intptr_t >(T.getAsOpaquePtr ()),
7147
+ DiagnosticsEngine::ak_qualtype);
7148
+ return DB;
7149
+ }
7150
+
7124
7151
// / Insertion operator for partial diagnostics. This allows sending QualType's
7125
7152
// / into a diagnostic with <<.
7126
- inline const StreamableDiagnosticBase &
7127
- operator <<( const StreamableDiagnosticBase &PD, QualType T) {
7153
+ inline const PartialDiagnostic & operator <<( const PartialDiagnostic &PD,
7154
+ QualType T) {
7128
7155
PD.AddTaggedVal (reinterpret_cast <intptr_t >(T.getAsOpaquePtr ()),
7129
7156
DiagnosticsEngine::ak_qualtype);
7130
7157
return PD;
0 commit comments