@@ -165,33 +165,33 @@ FileSpecificDiagnosticConsumer::subconsumerForLocation(SourceManager &SM,
165165void FileSpecificDiagnosticConsumer::handleDiagnostic (
166166 SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
167167 StringRef FormatString, ArrayRef<DiagnosticArgument> FormatArgs,
168- const DiagnosticInfo &Info, const SourceLoc defaultDiagnosticLoc ) {
168+ const DiagnosticInfo &Info, const SourceLoc bufferIndirectlyCausingDiagnostic ) {
169169
170170 HasAnErrorBeenConsumed |= Kind == DiagnosticKind::Error;
171171
172172 auto subconsumer =
173- findSubconsumer (SM, Loc, Kind, defaultDiagnosticLoc );
173+ findSubconsumer (SM, Loc, Kind, bufferIndirectlyCausingDiagnostic );
174174 if (subconsumer) {
175175 subconsumer.getValue ()->handleDiagnostic (
176- SM, Loc, Kind, FormatString, FormatArgs, Info, defaultDiagnosticLoc );
176+ SM, Loc, Kind, FormatString, FormatArgs, Info, bufferIndirectlyCausingDiagnostic );
177177 return ;
178178 }
179179 // Last resort: spray it everywhere
180180 for (auto &subconsumer : Subconsumers)
181181 subconsumer.handleDiagnostic (SM, Loc, Kind, FormatString, FormatArgs, Info,
182- defaultDiagnosticLoc );
182+ bufferIndirectlyCausingDiagnostic );
183183}
184184
185185Optional<FileSpecificDiagnosticConsumer::Subconsumer *>
186186FileSpecificDiagnosticConsumer::findSubconsumer (
187187 SourceManager &SM, SourceLoc loc, DiagnosticKind Kind,
188- SourceLoc defaultDiagnosticLoc ) {
188+ SourceLoc bufferIndirectlyCausingDiagnostic ) {
189189 // Ensure that a note goes to the same place as the preceeding non-note.
190190 switch (Kind) {
191191 case DiagnosticKind::Error:
192192 case DiagnosticKind::Warning:
193193 case DiagnosticKind::Remark: {
194- auto subconsumer = findSubconsumerForNonNote (SM, loc, defaultDiagnosticLoc );
194+ auto subconsumer = findSubconsumerForNonNote (SM, loc, bufferIndirectlyCausingDiagnostic );
195195 SubconsumerForSubsequentNotes = subconsumer;
196196 return subconsumer;
197197 }
@@ -203,13 +203,13 @@ FileSpecificDiagnosticConsumer::findSubconsumer(
203203Optional<FileSpecificDiagnosticConsumer::Subconsumer *>
204204FileSpecificDiagnosticConsumer::findSubconsumerForNonNote (
205205 SourceManager &SM, const SourceLoc loc,
206- const SourceLoc defaultDiagnosticLoc ) {
206+ const SourceLoc bufferIndirectlyCausingDiagnostic ) {
207207 if (auto subconsumer = subconsumerForLocation (SM, loc))
208208 return subconsumer; // A primary file with a .dia file
209209 // The diagnostic is located in a non-primary.
210210 // Try to put it in the current primary file's .dia file.
211- if (defaultDiagnosticLoc .isValid ())
212- return subconsumerForLocation (SM, defaultDiagnosticLoc );
211+ if (bufferIndirectlyCausingDiagnostic .isValid ())
212+ return subconsumerForLocation (SM, bufferIndirectlyCausingDiagnostic );
213213 return None;
214214}
215215
@@ -252,7 +252,7 @@ ForwardingDiagnosticConsumer::ForwardingDiagnosticConsumer(DiagnosticEngine &Tar
252252void ForwardingDiagnosticConsumer::handleDiagnostic (
253253 SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
254254 StringRef FormatString, ArrayRef<DiagnosticArgument> FormatArgs,
255- const DiagnosticInfo &Info, const SourceLoc defaultDiagnosticLoc ) {
255+ const DiagnosticInfo &Info, const SourceLoc bufferIndirectlyCausingDiagnostic ) {
256256 LLVM_DEBUG ({
257257 llvm::dbgs () << " ForwardingDiagnosticConsumer received diagnostic: " ;
258258 DiagnosticEngine::formatDiagnosticText (llvm::dbgs (), FormatString,
@@ -261,6 +261,6 @@ void ForwardingDiagnosticConsumer::handleDiagnostic(
261261 });
262262 for (auto *C : TargetEngine.getConsumers ()) {
263263 C->handleDiagnostic (SM, Loc, Kind, FormatString, FormatArgs, Info,
264- defaultDiagnosticLoc );
264+ bufferIndirectlyCausingDiagnostic );
265265 }
266266}
0 commit comments