Lines Matching refs:SM
43 const SourceManager &SM, in getImmediateMacroName() argument
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()
64 StringRef ExpansionBuffer = SM.getBufferData(ExpansionInfo.first); in getImmediateMacroName()
93 const SourceManager &SM, const LangOptions &LangOpts, in mergeFixits() argument
95 edit::Commit commit(SM, LangOpts); in mergeFixits()
116 edit::EditedSource Editor(SM, LangOpts); in mergeFixits()
128 const SourceManager *SM, in emitDiagnostic() argument
130 assert(SM || Loc.isInvalid()); in emitDiagnostic()
136 emitDiagnosticMessage(Loc, PresumedLoc(), Level, Message, Ranges, SM, D); in emitDiagnostic()
144 mergeFixits(FixItHints, *SM, LangOpts, MergedFixits); 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()
173 emitMacroExpansions(UnexpandedLoc, Level, MutableRanges, FixItHints, *SM, in emitDiagnostic()
213 const SourceManager &SM) { in emitIncludeStack() argument
226 emitIncludeStackRecursively(IncludeLoc, SM); in emitIncludeStack()
228 emitModuleBuildStack(SM); in emitIncludeStack()
229 emitImportStack(Loc, SM); in emitIncludeStack()
236 const SourceManager &SM) { in emitIncludeStackRecursively() argument
238 emitModuleBuildStack(SM); in emitIncludeStackRecursively()
242 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitIncludeStackRecursively()
249 std::pair<SourceLocation, StringRef> Imported = SM.getModuleImportLoc(Loc); in emitIncludeStackRecursively()
252 emitImportStackRecursively(Imported.first, Imported.second, SM); in emitIncludeStackRecursively()
257 emitIncludeStackRecursively(PLoc.getIncludeLoc(), SM); in emitIncludeStackRecursively()
260 emitIncludeLocation(Loc, PLoc, SM); in emitIncludeStackRecursively()
265 const SourceManager &SM) { in emitImportStack() argument
267 emitModuleBuildStack(SM); in emitImportStack()
272 = SM.getModuleImportLoc(Loc); in emitImportStack()
273 emitImportStackRecursively(NextImportLoc.first, NextImportLoc.second, SM); in emitImportStack()
280 const SourceManager &SM) { in emitImportStackRecursively() argument
285 PresumedLoc PLoc = SM.getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc); in emitImportStackRecursively()
291 = SM.getModuleImportLoc(Loc); in emitImportStackRecursively()
292 emitImportStackRecursively(NextImportLoc.first, NextImportLoc.second, SM); in emitImportStackRecursively()
295 emitImportLocation(Loc, PLoc, ModuleName, SM); in emitImportStackRecursively()
300 void DiagnosticRenderer::emitModuleBuildStack(const SourceManager &SM) { in emitModuleBuildStack() argument
301 ModuleBuildStack Stack = SM.getModuleBuildStack(); in emitModuleBuildStack()
327 const SourceManager *SM) { in mapDiagnosticRanges() argument
328 FileID CaretLocFileID = SM->getFileID(CaretLoc); in mapDiagnosticRanges()
336 FileID BeginFileID = SM->getFileID(Begin); in mapDiagnosticRanges()
337 FileID EndFileID = SM->getFileID(End); in mapDiagnosticRanges()
345 Begin = SM->getImmediateExpansionRange(Begin).first; in mapDiagnosticRanges()
346 BeginFileID = SM->getFileID(Begin); in mapDiagnosticRanges()
352 End = SM->getImmediateExpansionRange(End).second; in mapDiagnosticRanges()
353 EndFileID = SM->getFileID(End); in mapDiagnosticRanges()
362 if (SM->isMacroArgExpansion(Begin)) { in mapDiagnosticRanges()
363 Begin = SM->getImmediateSpellingLoc(Begin); in mapDiagnosticRanges()
364 End = SM->getImmediateSpellingLoc(End); in mapDiagnosticRanges()
366 Begin = SM->getImmediateExpansionRange(Begin).first; in mapDiagnosticRanges()
367 End = SM->getImmediateExpansionRange(End).second; in mapDiagnosticRanges()
369 BeginFileID = SM->getFileID(Begin); in mapDiagnosticRanges()
370 if (BeginFileID != SM->getFileID(End)) { in mapDiagnosticRanges()
380 Begin = SM->getSpellingLoc(Begin); in mapDiagnosticRanges()
381 End = SM->getSpellingLoc(End); in mapDiagnosticRanges()
391 const SourceManager &SM) { in emitCaret() argument
393 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in emitCaret()
394 emitCodeContext(Loc, Level, SpellingRanges, Hints, SM); in emitCaret()
413 const SourceManager &SM, in emitMacroExpansions() argument
419 SourceLocation OneLevelUp = SM.getImmediateMacroCallerLoc(Loc); in emitMacroExpansions()
421 emitMacroExpansions(OneLevelUp, Level, Ranges, Hints, SM, in emitMacroExpansions()
456 if (SM.isMacroArgExpansion(Loc)) in emitMacroExpansions()
457 SpellingLoc = SM.getImmediateExpansionRange(Loc).first; in emitMacroExpansions()
458 SpellingLoc = SM.getSpellingLoc(SpellingLoc); in emitMacroExpansions()
462 mapDiagnosticRanges(Loc, Ranges, SpellingRanges, &SM); in emitMacroExpansions()
466 StringRef MacroName = getImmediateMacroName(Loc, SM, LangOpts); in emitMacroExpansions()
472 SpellingRanges, None, &SM); in emitMacroExpansions()
479 const SourceManager &SM) { in emitIncludeLocation() argument
485 emitNote(Loc, Message.str(), &SM); in emitIncludeLocation()
491 const SourceManager &SM) { in emitImportLocation() argument
497 emitNote(Loc, Message.str(), &SM); in emitImportLocation()
504 const SourceManager &SM) { in emitBuildingModuleLocation() argument
513 emitNote(Loc, Message.str(), &SM); in emitBuildingModuleLocation()