Lines Matching refs:Loc
42 static StringRef getImmediateMacroName(SourceLocation Loc, in getImmediateMacroName() argument
45 assert(Loc.isMacroID() && "Only reasonble to call this on macros"); in getImmediateMacroName()
47 while (SM.isMacroArgExpansion(Loc)) in getImmediateMacroName()
48 Loc = SM.getImmediateExpansionRange(Loc).first; in getImmediateMacroName()
52 if (!SM.getFileEntryForID(SM.getFileID(SM.getSpellingLoc(Loc)))) in getImmediateMacroName()
58 Loc = SM.getSpellingLoc(SM.getImmediateExpansionRange(Loc).first); in getImmediateMacroName()
62 std::pair<FileID, unsigned> ExpansionInfo = SM.getDecomposedLoc(Loc); in getImmediateMacroName()
63 unsigned MacroTokenLength = Lexer::MeasureTokenLength(Loc, SM, LangOpts); in getImmediateMacroName()
123 void DiagnosticRenderer::emitDiagnostic(SourceLocation Loc, in emitDiagnostic() argument
130 assert(SM || Loc.isInvalid()); in emitDiagnostic()
134 if (!Loc.isValid()) in emitDiagnostic()
136 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, SM, D); in emitDiagnostic()
154 SourceLocation UnexpandedLoc = Loc; in emitDiagnostic()
157 Loc = SM->getFileLoc(Loc); in emitDiagnostic()
159 PresumedLoc PLoc = SM->getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitDiagnostic()
163 emitIncludeStack(Loc, PLoc, Level, *SM); in emitDiagnostic()
166 emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, SM, D); in emitDiagnostic()
167 emitCaret(Loc, Level, MutableRanges, FixItHints, *SM); in emitDiagnostic()
178 LastLoc = Loc; in emitDiagnostic()
204 void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc, in emitIncludeStack() argument
223 emitImportStack(Loc, SM); in emitIncludeStack()
229 void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc, in emitIncludeStackRecursively() argument
231 if (Loc.isInvalid()) { in emitIncludeStackRecursively()
236 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitIncludeStackRecursively()
243 std::pair<SourceLocation, StringRef> Imported = SM.getModuleImportLoc(Loc); in emitIncludeStackRecursively()
254 emitIncludeLocation(Loc, PLoc, SM); in emitIncludeStackRecursively()
258 void DiagnosticRenderer::emitImportStack(SourceLocation Loc, in emitImportStack() argument
260 if (Loc.isInvalid()) { in emitImportStack()
266 = SM.getModuleImportLoc(Loc); in emitImportStack()
272 void DiagnosticRenderer::emitImportStackRecursively(SourceLocation Loc, in emitImportStackRecursively() argument
275 if (Loc.isInvalid()) { in emitImportStackRecursively()
279 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitImportStackRecursively()
285 = SM.getModuleImportLoc(Loc); in emitImportStackRecursively()
289 emitImportLocation(Loc, PLoc, ModuleName, SM); in emitImportStackRecursively()
381 void DiagnosticRenderer::emitCaret(SourceLocation Loc, in emitCaret() argument
387 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in emitCaret()
388 emitCodeContext(Loc, Level, SpellingRanges, Hints, SM); in emitCaret()
403 void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc, in emitMacroExpansions() argument
410 assert(!Loc.isInvalid() && "must have a valid source location here"); in emitMacroExpansions()
413 SourceLocation OneLevelUp = SM.getImmediateMacroCallerLoc(Loc); in emitMacroExpansions()
447 SourceLocation SpellingLoc = Loc; in emitMacroExpansions()
450 if (SM.isMacroArgExpansion(Loc)) in emitMacroExpansions()
451 SpellingLoc = SM.getImmediateExpansionRange(Loc).first; in emitMacroExpansions()
456 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in emitMacroExpansions()
460 StringRef MacroName = getImmediateMacroName(Loc, SM, LangOpts); in emitMacroExpansions()
471 void DiagnosticNoteRenderer::emitIncludeLocation(SourceLocation Loc, in emitIncludeLocation() argument
479 emitNote(Loc, Message.str(), &SM); in emitIncludeLocation()
482 void DiagnosticNoteRenderer::emitImportLocation(SourceLocation Loc, in emitImportLocation() argument
491 emitNote(Loc, Message.str(), &SM); in emitImportLocation()
495 DiagnosticNoteRenderer::emitBuildingModuleLocation(SourceLocation Loc, in emitBuildingModuleLocation() argument
504 emitNote(Loc, Message.str(), &SM); in emitBuildingModuleLocation()