Lines Matching defs:Loc

86 void DiagnosticRenderer::emitDiagnostic(FullSourceLoc Loc,
92 assert(Loc.hasManager() || Loc.isInvalid());
96 if (!Loc.isValid())
98 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, D);
105 mergeFixits(FixItHints, Loc.getManager(), LangOpts, MergedFixits);
113 FullSourceLoc UnexpandedLoc = Loc;
116 Loc = Loc.getFileLoc();
118 PresumedLoc PLoc = Loc.getPresumedLoc(DiagOpts->ShowPresumedLoc);
122 emitIncludeStack(Loc, PLoc, Level);
125 emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, D);
126 emitCaret(Loc, Level, MutableRanges, FixItHints);
128 // If this location is within a macro, walk from UnexpandedLoc up to Loc
135 LastLoc = Loc;
160 /// \param Loc The diagnostic location.
163 void DiagnosticRenderer::emitIncludeStack(FullSourceLoc Loc, PresumedLoc PLoc,
167 : FullSourceLoc(PLoc.getIncludeLoc(), Loc.getManager());
181 emitModuleBuildStack(Loc.getManager());
182 emitImportStack(Loc);
188 void DiagnosticRenderer::emitIncludeStackRecursively(FullSourceLoc Loc) {
189 if (Loc.isInvalid()) {
190 emitModuleBuildStack(Loc.getManager());
194 PresumedLoc PLoc = Loc.getPresumedLoc(DiagOpts->ShowPresumedLoc);
201 std::pair<FullSourceLoc, StringRef> Imported = Loc.getModuleImportLoc();
210 FullSourceLoc(PLoc.getIncludeLoc(), Loc.getManager()));
213 emitIncludeLocation(Loc, PLoc);
217 void DiagnosticRenderer::emitImportStack(FullSourceLoc Loc) {
218 if (Loc.isInvalid()) {
219 emitModuleBuildStack(Loc.getManager());
223 std::pair<FullSourceLoc, StringRef> NextImportLoc = Loc.getModuleImportLoc();
229 void DiagnosticRenderer::emitImportStackRecursively(FullSourceLoc Loc,
235 PresumedLoc PLoc = Loc.getPresumedLoc(DiagOpts->ShowPresumedLoc);
238 std::pair<FullSourceLoc, StringRef> NextImportLoc = Loc.getModuleImportLoc();
242 emitImportLocation(Loc, PLoc, ModuleName);
259 retrieveMacroLocation(SourceLocation Loc, FileID MacroFileID,
264 assert(SM->getFileID(Loc) == MacroFileID);
266 return Loc;
267 if (!Loc.isMacroID())
272 if (SM->isMacroArgExpansion(Loc)) {
278 CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange);
279 MacroArgRange = SM->getImmediateExpansionRange(Loc);
281 MacroRange = SM->getImmediateExpansionRange(Loc);
283 CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange);
314 static void getMacroArgExpansionFileIDs(SourceLocation Loc,
317 while (Loc.isMacroID()) {
318 if (SM->isMacroArgExpansion(Loc)) {
319 IDs.push_back(SM->getFileID(Loc));
320 Loc = SM->getImmediateSpellingLoc(Loc);
322 auto ExpRange = SM->getImmediateExpansionRange(Loc);
323 Loc = IsBegin ? ExpRange.getBegin() : ExpRange.getEnd();
422 void DiagnosticRenderer::emitCaret(FullSourceLoc Loc,
427 mapDiagnosticRanges(Loc, Ranges, SpellingRanges);
428 emitCodeContext(Loc, Level, SpellingRanges, Hints);
434 FullSourceLoc Loc, DiagnosticsEngine::Level Level,
438 FullSourceLoc SpellingLoc = Loc.getSpellingLoc();
442 mapDiagnosticRanges(Loc, Ranges, SpellingRanges);
447 Loc, Loc.getManager(), LangOpts);
457 /// Check that the macro argument location of Loc starts with ArgumentLoc.
460 static bool checkLocForMacroArgExpansion(SourceLocation Loc,
464 if (SM.isMacroArgExpansion(Loc, &MacroLoc)) {
487 /// macro argument expansion as Loc.
488 static bool checkRangesForMacroArgExpansion(FullSourceLoc Loc,
490 assert(Loc.isMacroID() && "Must be a macro expansion!");
493 mapDiagnosticRanges(Loc, Ranges, SpellingRanges);
505 // Set the ArgumentLoc to the beginning location of the expansion of Loc
507 if (!Loc.isMacroArgExpansion(&ArgumentLoc))
511 if (!checkRangeForMacroArgExpansion(Range, Loc.getManager(), ArgumentLoc))
524 /// \param Loc The location for this caret.
528 void DiagnosticRenderer::emitMacroExpansions(FullSourceLoc Loc,
532 assert(Loc.isValid() && "must have a valid source location here");
533 const SourceManager &SM = Loc.getManager();
534 SourceLocation L = Loc;
595 void DiagnosticNoteRenderer::emitIncludeLocation(FullSourceLoc Loc,
602 emitNote(Loc, Message.str());
605 void DiagnosticNoteRenderer::emitImportLocation(FullSourceLoc Loc,
616 emitNote(Loc, Message.str());
619 void DiagnosticNoteRenderer::emitBuildingModuleLocation(FullSourceLoc Loc,
630 emitNote(Loc, Message.str());