Lines Matching refs:Loc
81 void DiagnosticRenderer::emitDiagnostic(SourceLocation Loc, in emitDiagnostic() argument
88 assert(SM || Loc.isInvalid()); in emitDiagnostic()
92 if (!Loc.isValid()) in emitDiagnostic()
94 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, SM, D); in emitDiagnostic()
112 SourceLocation UnexpandedLoc = Loc; in emitDiagnostic()
115 Loc = SM->getFileLoc(Loc); in emitDiagnostic()
117 PresumedLoc PLoc = SM->getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitDiagnostic()
121 emitIncludeStack(Loc, PLoc, Level, *SM); in emitDiagnostic()
124 emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, SM, D); in emitDiagnostic()
125 emitCaret(Loc, Level, MutableRanges, FixItHints, *SM); in emitDiagnostic()
134 LastLoc = Loc; in emitDiagnostic()
166 void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc, in emitIncludeStack() argument
186 emitImportStack(Loc, SM); in emitIncludeStack()
192 void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc, in emitIncludeStackRecursively() argument
194 if (Loc.isInvalid()) { in emitIncludeStackRecursively()
199 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitIncludeStackRecursively()
206 std::pair<SourceLocation, StringRef> Imported = SM.getModuleImportLoc(Loc); in emitIncludeStackRecursively()
217 emitIncludeLocation(Loc, PLoc, SM); in emitIncludeStackRecursively()
221 void DiagnosticRenderer::emitImportStack(SourceLocation Loc, in emitImportStack() argument
223 if (Loc.isInvalid()) { in emitImportStack()
229 = SM.getModuleImportLoc(Loc); in emitImportStack()
235 void DiagnosticRenderer::emitImportStackRecursively(SourceLocation Loc, in emitImportStackRecursively() argument
242 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitImportStackRecursively()
246 = SM.getModuleImportLoc(Loc); in emitImportStackRecursively()
250 emitImportLocation(Loc, PLoc, ModuleName, SM); in emitImportStackRecursively()
271 retrieveMacroLocation(SourceLocation Loc, FileID MacroFileID, in retrieveMacroLocation() argument
275 assert(SM->getFileID(Loc) == MacroFileID); in retrieveMacroLocation()
277 return Loc; in retrieveMacroLocation()
278 if (!Loc.isMacroID()) in retrieveMacroLocation()
283 if (SM->isMacroArgExpansion(Loc)) { in retrieveMacroLocation()
288 MacroLocation = SM->getImmediateSpellingLoc(Loc); in retrieveMacroLocation()
289 MacroArgLocation = IsBegin ? SM->getImmediateExpansionRange(Loc).first in retrieveMacroLocation()
290 : SM->getImmediateExpansionRange(Loc).second; in retrieveMacroLocation()
292 MacroLocation = IsBegin ? SM->getImmediateExpansionRange(Loc).first in retrieveMacroLocation()
293 : SM->getImmediateExpansionRange(Loc).second; in retrieveMacroLocation()
294 MacroArgLocation = SM->getImmediateSpellingLoc(Loc); in retrieveMacroLocation()
313 static void getMacroArgExpansionFileIDs(SourceLocation Loc, in getMacroArgExpansionFileIDs() argument
316 while (Loc.isMacroID()) { in getMacroArgExpansionFileIDs()
317 if (SM->isMacroArgExpansion(Loc)) { in getMacroArgExpansionFileIDs()
318 IDs.push_back(SM->getFileID(Loc)); in getMacroArgExpansionFileIDs()
319 Loc = SM->getImmediateSpellingLoc(Loc); in getMacroArgExpansionFileIDs()
321 auto ExpRange = SM->getImmediateExpansionRange(Loc); in getMacroArgExpansionFileIDs()
322 Loc = IsBegin ? ExpRange.first : ExpRange.second; in getMacroArgExpansionFileIDs()
409 void DiagnosticRenderer::emitCaret(SourceLocation Loc, in emitCaret() argument
415 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in emitCaret()
416 emitCodeContext(Loc, Level, SpellingRanges, Hints, SM); in emitCaret()
422 SourceLocation Loc, in emitSingleMacroExpansion() argument
428 SourceLocation SpellingLoc = SM.getSpellingLoc(Loc); in emitSingleMacroExpansion()
432 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in emitSingleMacroExpansion()
437 Lexer::getImmediateMacroNameForDiagnostics(Loc, SM, LangOpts); in emitSingleMacroExpansion()
450 static bool checkLocForMacroArgExpansion(SourceLocation Loc, in checkLocForMacroArgExpansion() argument
454 if (SM.isMacroArgExpansion(Loc, &MacroLoc)) { in checkLocForMacroArgExpansion()
478 static bool checkRangesForMacroArgExpansion(SourceLocation Loc, in checkRangesForMacroArgExpansion() argument
481 assert(Loc.isMacroID() && "Must be a macro expansion!"); in checkRangesForMacroArgExpansion()
484 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in checkRangesForMacroArgExpansion()
499 if (!SM.isMacroArgExpansion(Loc,&ArgumentLoc)) in checkRangesForMacroArgExpansion()
521 void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc, in emitMacroExpansions() argument
526 assert(Loc.isValid() && "must have a valid source location here"); in emitMacroExpansions()
531 while (Loc.isMacroID()) { in emitMacroExpansions()
534 if (SM.isMacroArgExpansion(Loc)) in emitMacroExpansions()
535 LocationStack.push_back(SM.getImmediateExpansionRange(Loc).first); in emitMacroExpansions()
537 LocationStack.push_back(Loc); in emitMacroExpansions()
539 if (checkRangesForMacroArgExpansion(Loc, Ranges, SM)) in emitMacroExpansions()
542 Loc = SM.getImmediateMacroCallerLoc(Loc); in emitMacroExpansions()
547 if (Loc.isFileID()) in emitMacroExpansions()
548 Loc = SM.getImmediateMacroCallerLoc(LocationStack.back()); in emitMacroExpansions()
549 assert(Loc.isValid() && "must have a valid source location here"); in emitMacroExpansions()
587 void DiagnosticNoteRenderer::emitIncludeLocation(SourceLocation Loc, in emitIncludeLocation() argument
595 emitNote(Loc, Message.str(), &SM); in emitIncludeLocation()
598 void DiagnosticNoteRenderer::emitImportLocation(SourceLocation Loc, in emitImportLocation() argument
610 emitNote(Loc, Message.str(), &SM); in emitImportLocation()
614 DiagnosticNoteRenderer::emitBuildingModuleLocation(SourceLocation Loc, in emitBuildingModuleLocation() argument
626 emitNote(Loc, Message.str(), &SM); in emitBuildingModuleLocation()