Home | History | Annotate | Download | only in Frontend

Lines Matching full: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 virtual void insert(SourceLocation loc, StringRef text) {
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;
201 /// \param Loc The diagnostic location.
204 void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc,
223 emitImportStack(Loc, SM);
229 void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc,
231 if (Loc.isInvalid()) {
236 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc);
243 std::pair<SourceLocation, StringRef> Imported = SM.getModuleImportLoc(Loc);
254 emitIncludeLocation(Loc, PLoc, SM);
258 void DiagnosticRenderer::emitImportStack(SourceLocation Loc,
260 if (Loc.isInvalid()) {
266 = SM.getModuleImportLoc(Loc);
272 void DiagnosticRenderer::emitImportStackRecursively(SourceLocation Loc,
275 if (Loc.isInvalid()) {
279 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc);
285 = SM.getModuleImportLoc(Loc);
289 emitImportLocation(Loc, PLoc, ModuleName, SM);
381 void DiagnosticRenderer::emitCaret(SourceLocation Loc,
387 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM);
388 emitCodeContext(Loc, Level, SpellingRanges, Hints, SM);
398 /// \param Loc The location for this caret.
403 void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc,
410 assert(!Loc.isInvalid() && "must have a valid source location here");
413 Loc);
447 SourceLocation SpellingLoc = Loc;
450 if (SM.isMacroArgExpansion(Loc))
451 SpellingLoc = SM.getImmediateExpansionRange(Loc).first;
456 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM);
460 StringRef MacroName = getImmediateMacroName(Loc, SM, LangOpts);
471 void DiagnosticNoteRenderer::emitIncludeLocation(SourceLocation Loc,
479 emitNote(Loc, Message.str(), &SM);
482 void DiagnosticNoteRenderer::emitImportLocation(SourceLocation Loc,
491 emitNote(Loc, Message.str(), &SM);
495 DiagnosticNoteRenderer::emitBuildingModuleLocation(SourceLocation Loc,
504 emitNote(Loc, Message.str(), &SM);