Home | History | Annotate | Download | only in Frontend

Lines Matching refs:Loc

42 static StringRef getImmediateMacroName(SourceLocation Loc,
45 assert(Loc.isMacroID() && "Only reasonble to call this on macros");
47 while (SM.isMacroArgExpansion(Loc))
48 Loc = SM.getImmediateExpansionRange(Loc).first;
52 if (!SM.getFileEntryForID(SM.getFileID(SM.getSpellingLoc(Loc))))
58 Loc = SM.getSpellingLoc(SM.getImmediateExpansionRange(Loc).first);
62 std::pair<FileID, unsigned> ExpansionInfo = SM.getDecomposedLoc(Loc);
63 unsigned MacroTokenLength = Lexer::MeasureTokenLength(Loc, SM, LangOpts);
82 void insert(SourceLocation loc, StringRef text) override {
83 MergedFixits.push_back(FixItHint::CreateInsertion(loc, text));
123 void DiagnosticRenderer::emitDiagnostic(SourceLocation Loc,
130 assert(SM || Loc.isInvalid());
134 if (!Loc.isValid())
136 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, SM, D);
154 SourceLocation UnexpandedLoc = Loc;
157 Loc = SM->getFileLoc(Loc);
159 PresumedLoc PLoc = SM->getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc);
163 emitIncludeStack(Loc, PLoc, Level, *SM);
166 emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, SM, D);
167 emitCaret(Loc, Level, MutableRanges, FixItHints, *SM);
169 // If this location is within a macro, walk from UnexpandedLoc up to Loc
178 LastLoc = Loc;
207 /// \param Loc The diagnostic location.
210 void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc,
229 emitImportStack(Loc, SM);
235 void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc,
237 if (Loc.isInvalid()) {
242 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc);
249 std::pair<SourceLocation, StringRef> Imported = SM.getModuleImportLoc(Loc);
260 emitIncludeLocation(Loc, PLoc, SM);
264 void DiagnosticRenderer::emitImportStack(SourceLocation Loc,
266 if (Loc.isInvalid()) {
272 = SM.getModuleImportLoc(Loc);
278 void DiagnosticRenderer::emitImportStackRecursively(SourceLocation Loc,
281 if (Loc.isInvalid()) {
285 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc);
291 = SM.getModuleImportLoc(Loc);
295 emitImportLocation(Loc, PLoc, ModuleName, SM);
387 void DiagnosticRenderer::emitCaret(SourceLocation Loc,
393 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM);
394 emitCodeContext(Loc, Level, SpellingRanges, Hints, SM);
404 /// \param Loc The location for this caret.
409 void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc,
416 assert(!Loc.isInvalid() && "must have a valid source location here");
419 SourceLocation OneLevelUp = SM.getImmediateMacroCallerLoc(Loc);
453 SourceLocation SpellingLoc = Loc;
456 if (SM.isMacroArgExpansion(Loc))
457 SpellingLoc = SM.getImmediateExpansionRange(Loc).first;
462 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM);
466 StringRef MacroName = getImmediateMacroName(Loc, SM, LangOpts);
477 void DiagnosticNoteRenderer::emitIncludeLocation(SourceLocation Loc,
485 emitNote(Loc, Message.str(), &SM);
488 void DiagnosticNoteRenderer::emitImportLocation(SourceLocation Loc,
497 emitNote(Loc, Message.str(), &SM);
501 DiagnosticNoteRenderer::emitBuildingModuleLocation(SourceLocation Loc,
513 emitNote(Loc, Message.str(), &SM);