Lines Matching refs:Loc
87 void DiagnosticRenderer::emitDiagnostic(FullSourceLoc Loc, in emitDiagnostic() argument
93 assert(Loc.hasManager() || Loc.isInvalid()); in emitDiagnostic()
97 if (!Loc.isValid()) in emitDiagnostic()
99 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, D); in emitDiagnostic()
107 mergeFixits(FixItHints, Loc.getManager(), LangOpts, MergedFixits); in emitDiagnostic()
115 FullSourceLoc UnexpandedLoc = Loc; in emitDiagnostic()
118 Loc = Loc.getFileLoc(); in emitDiagnostic()
120 PresumedLoc PLoc = Loc.getPresumedLoc(DiagOpts->ShowPresumedLoc); in emitDiagnostic()
124 emitIncludeStack(Loc, PLoc, Level); in emitDiagnostic()
127 emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, D); in emitDiagnostic()
128 emitCaret(Loc, Level, MutableRanges, FixItHints); in emitDiagnostic()
137 LastLoc = Loc; in emitDiagnostic()
165 void DiagnosticRenderer::emitIncludeStack(FullSourceLoc Loc, PresumedLoc PLoc, in emitIncludeStack() argument
169 : FullSourceLoc(PLoc.getIncludeLoc(), Loc.getManager()); in emitIncludeStack()
183 emitModuleBuildStack(Loc.getManager()); in emitIncludeStack()
184 emitImportStack(Loc); in emitIncludeStack()
190 void DiagnosticRenderer::emitIncludeStackRecursively(FullSourceLoc Loc) { in emitIncludeStackRecursively() argument
191 if (Loc.isInvalid()) { in emitIncludeStackRecursively()
192 emitModuleBuildStack(Loc.getManager()); in emitIncludeStackRecursively()
196 PresumedLoc PLoc = Loc.getPresumedLoc(DiagOpts->ShowPresumedLoc); in emitIncludeStackRecursively()
203 std::pair<FullSourceLoc, StringRef> Imported = Loc.getModuleImportLoc(); in emitIncludeStackRecursively()
212 FullSourceLoc(PLoc.getIncludeLoc(), Loc.getManager())); in emitIncludeStackRecursively()
215 emitIncludeLocation(Loc, PLoc); in emitIncludeStackRecursively()
219 void DiagnosticRenderer::emitImportStack(FullSourceLoc Loc) { in emitImportStack() argument
220 if (Loc.isInvalid()) { in emitImportStack()
221 emitModuleBuildStack(Loc.getManager()); in emitImportStack()
225 std::pair<FullSourceLoc, StringRef> NextImportLoc = Loc.getModuleImportLoc(); in emitImportStack()
231 void DiagnosticRenderer::emitImportStackRecursively(FullSourceLoc Loc, in emitImportStackRecursively() argument
237 PresumedLoc PLoc = Loc.getPresumedLoc(DiagOpts->ShowPresumedLoc); in emitImportStackRecursively()
240 std::pair<FullSourceLoc, StringRef> NextImportLoc = Loc.getModuleImportLoc(); in emitImportStackRecursively()
244 emitImportLocation(Loc, PLoc, ModuleName); in emitImportStackRecursively()
261 retrieveMacroLocation(SourceLocation Loc, FileID MacroFileID, in retrieveMacroLocation() argument
266 assert(SM->getFileID(Loc) == MacroFileID); in retrieveMacroLocation()
268 return Loc; in retrieveMacroLocation()
269 if (!Loc.isMacroID()) in retrieveMacroLocation()
274 if (SM->isMacroArgExpansion(Loc)) { in retrieveMacroLocation()
280 CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange); in retrieveMacroLocation()
281 MacroArgRange = SM->getImmediateExpansionRange(Loc); in retrieveMacroLocation()
283 MacroRange = SM->getImmediateExpansionRange(Loc); in retrieveMacroLocation()
285 CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange); in retrieveMacroLocation()
316 static void getMacroArgExpansionFileIDs(SourceLocation Loc, in getMacroArgExpansionFileIDs() argument
319 while (Loc.isMacroID()) { in getMacroArgExpansionFileIDs()
320 if (SM->isMacroArgExpansion(Loc)) { in getMacroArgExpansionFileIDs()
321 IDs.push_back(SM->getFileID(Loc)); in getMacroArgExpansionFileIDs()
322 Loc = SM->getImmediateSpellingLoc(Loc); in getMacroArgExpansionFileIDs()
324 auto ExpRange = SM->getImmediateExpansionRange(Loc); in getMacroArgExpansionFileIDs()
325 Loc = IsBegin ? ExpRange.getBegin() : ExpRange.getEnd(); in getMacroArgExpansionFileIDs()
424 void DiagnosticRenderer::emitCaret(FullSourceLoc Loc, in emitCaret() argument
429 mapDiagnosticRanges(Loc, Ranges, SpellingRanges); in emitCaret()
430 emitCodeContext(Loc, Level, SpellingRanges, Hints); in emitCaret()
436 FullSourceLoc Loc, DiagnosticsEngine::Level Level, in emitSingleMacroExpansion() argument
440 FullSourceLoc SpellingLoc = Loc.getSpellingLoc(); in emitSingleMacroExpansion()
444 mapDiagnosticRanges(Loc, Ranges, SpellingRanges); in emitSingleMacroExpansion()
449 Loc, Loc.getManager(), LangOpts); in emitSingleMacroExpansion()
462 static bool checkLocForMacroArgExpansion(SourceLocation Loc, in checkLocForMacroArgExpansion() argument
466 if (SM.isMacroArgExpansion(Loc, &MacroLoc)) { in checkLocForMacroArgExpansion()
490 static bool checkRangesForMacroArgExpansion(FullSourceLoc Loc, in checkRangesForMacroArgExpansion() argument
492 assert(Loc.isMacroID() && "Must be a macro expansion!"); in checkRangesForMacroArgExpansion()
495 mapDiagnosticRanges(Loc, Ranges, SpellingRanges); in checkRangesForMacroArgExpansion()
511 if (!Loc.isMacroArgExpansion(&ArgumentLoc)) in checkRangesForMacroArgExpansion()
515 if (!checkRangeForMacroArgExpansion(Range, Loc.getManager(), ArgumentLoc)) in checkRangesForMacroArgExpansion()
532 void DiagnosticRenderer::emitMacroExpansions(FullSourceLoc Loc, in emitMacroExpansions() argument
536 assert(Loc.isValid() && "must have a valid source location here"); in emitMacroExpansions()
537 const SourceManager &SM = Loc.getManager(); in emitMacroExpansions()
538 SourceLocation L = Loc; in emitMacroExpansions()
599 void DiagnosticNoteRenderer::emitIncludeLocation(FullSourceLoc Loc, in emitIncludeLocation() argument
606 emitNote(Loc, Message.str()); in emitIncludeLocation()
609 void DiagnosticNoteRenderer::emitImportLocation(FullSourceLoc Loc, in emitImportLocation() argument
620 emitNote(Loc, Message.str()); in emitImportLocation()
623 void DiagnosticNoteRenderer::emitBuildingModuleLocation(FullSourceLoc Loc, in emitBuildingModuleLocation() argument
634 emitNote(Loc, Message.str()); in emitBuildingModuleLocation()