Lines Matching refs:SM
231 SpellingRegion(SourceManager &SM, SourceLocation LocStart, in SpellingRegion()
233 LineStart = SM.getSpellingLineNumber(LocStart); in SpellingRegion()
234 ColumnStart = SM.getSpellingColumnNumber(LocStart); in SpellingRegion()
235 LineEnd = SM.getSpellingLineNumber(LocEnd); in SpellingRegion()
236 ColumnEnd = SM.getSpellingColumnNumber(LocEnd); in SpellingRegion()
239 SpellingRegion(SourceManager &SM, SourceMappingRegion &R) in SpellingRegion()
240 : SpellingRegion(SM, R.getBeginLoc(), R.getEndLoc()) {} in SpellingRegion()
255 SourceManager &SM; member in __anon015dba650211::CoverageMappingBuilder
277 CoverageMappingBuilder(CoverageMappingModuleGen &CVM, SourceManager &SM, in CoverageMappingBuilder() argument
279 : CVM(CVM), SM(SM), LangOpts(LangOpts) {} in CoverageMappingBuilder()
286 Lexer::MeasureTokenLength(SM.getSpellingLoc(Loc), SM, LangOpts); in getPreciseTokenLocEnd()
293 return Loc.getLocWithOffset(-SM.getFileOffset(Loc)); in getStartOfFileOrMacro()
294 return SM.getLocForStartOfFile(SM.getFileID(Loc)); in getStartOfFileOrMacro()
300 return Loc.getLocWithOffset(SM.getFileIDSize(SM.getFileID(Loc)) - in getEndOfFileOrMacro()
301 SM.getFileOffset(Loc)); in getEndOfFileOrMacro()
302 return SM.getLocForEndOfFile(SM.getFileID(Loc)); in getEndOfFileOrMacro()
316 SM.isWrittenInScratchSpace(SM.getSpellingLoc(Loc))) { in getNonScratchExpansionLoc()
317 auto ExpansionRange = SM.getImmediateExpansionRange(Loc); in getNonScratchExpansionLoc()
330 return SM.getIncludeLoc(SM.getFileID(Loc)); in getIncludeOrExpansionLoc()
331 Loc = SM.getImmediateExpansionRange(Loc).getBegin(); in getIncludeOrExpansionLoc()
339 return SM.getBufferName(SM.getSpellingLoc(Loc)) == "<built-in>"; in isInBuiltin()
348 } while (!SM.isInFileID(Loc, Parent)); in isNestedIn()
355 while (SM.isMacroArgExpansion(Loc) || isInBuiltin(Loc)) in getStart()
356 Loc = SM.getImmediateExpansionRange(Loc).getBegin(); in getStart()
363 while (SM.isMacroArgExpansion(Loc) || isInBuiltin(Loc)) in getEnd()
364 Loc = SM.getImmediateExpansionRange(Loc).getBegin(); in getEnd()
391 if (!SystemHeadersCoverage && SM.isInSystemMacro(Loc)) { in gatherFileIDs()
392 auto BeginLoc = SM.getSpellingLoc(Loc); in gatherFileIDs()
393 auto EndLoc = SM.getSpellingLoc(Region.getEndLoc()); in gatherFileIDs()
394 if (SM.isWrittenInSameFile(BeginLoc, EndLoc)) { in gatherFileIDs()
395 Loc = SM.getFileLoc(Loc); in gatherFileIDs()
397 Region.setEndLoc(SM.getFileLoc(Region.getEndLoc())); in gatherFileIDs()
401 FileID File = SM.getFileID(Loc); in gatherFileIDs()
406 !SM.isInSystemHeader(SM.getSpellingLoc(Loc))); in gatherFileIDs()
418 FileID SpellingFile = SM.getDecomposedSpellingLoc(Loc).first; in gatherFileIDs()
419 auto Entry = SM.getFileEntryRefForID(SpellingFile); in gatherFileIDs()
423 FileIDMapping[SM.getFileID(Loc)] = std::make_pair(Mapping.size(), Loc); in gatherFileIDs()
432 auto Mapping = FileIDMapping.find(SM.getFileID(Loc)); in getCoverageFileID()
443 std::optional<SpellingRegion> adjustSkippedRange(SourceManager &SM, in adjustSkippedRange() argument
448 SpellingRegion SR{SM, LocStart, LocEnd}; in adjustSkippedRange()
450 if (PrevTokLoc.isValid() && SM.isWrittenInSameFile(LocStart, PrevTokLoc) && in adjustSkippedRange()
451 SR.LineStart == SM.getSpellingLineNumber(PrevTokLoc)) in adjustSkippedRange()
453 if (NextTokLoc.isValid() && SM.isWrittenInSameFile(LocEnd, NextTokLoc) && in adjustSkippedRange()
454 SR.LineEnd == SM.getSpellingLineNumber(NextTokLoc)) { in adjustSkippedRange()
484 assert(SM.isWrittenInSameFile(LocStart, LocEnd) && in gatherSkippedRegions()
492 SR = adjustSkippedRange(SM, LocStart, LocEnd, I.PrevTokLoc, in gatherSkippedRegions()
495 SR = {SM, LocStart, LocEnd}; in gatherSkippedRegions()
517 assert(SM.getFileID(LocStart).isValid() && "region in invalid file"); in emitSourceRegions()
522 SM.isInSystemHeader(SM.getSpellingLoc(LocStart))) { in emitSourceRegions()
537 assert(SM.isWrittenInSameFile(LocStart, LocEnd) && in emitSourceRegions()
551 SpellingRegion SR{SM, LocStart, LocEnd}; in emitSourceRegions()
595 assert(SM.isWrittenInSameFile(ParentLoc, LocEnd) && in emitExpansionRegions()
599 SpellingRegion SR{SM, ParentLoc, LocEnd}; in emitExpansionRegions()
612 EmptyCoverageMappingBuilder(CoverageMappingModuleGen &CVM, SourceManager &SM, in EmptyCoverageMappingBuilder()
614 : CoverageMappingBuilder(CVM, SM, LangOpts) {} in EmptyCoverageMappingBuilder()
622 if (!SM.isWrittenInSameFile(Start, End)) { in VisitDecl()
625 FileID StartFileID = SM.getFileID(Start); in VisitDecl()
626 FileID EndFileID = SM.getFileID(End); in VisitDecl()
631 StartFileID = SM.getFileID(Start); in VisitDecl()
637 EndFileID = SM.getFileID(End); in VisitDecl()
1011 while (!SM.isWrittenInSameFile(StartLoc, EndLoc)) { in popRegions()
1022 assert(SM.isWrittenInSameFile(NestedLoc, EndLoc)); in popRegions()
1042 assert(SM.isWrittenInSameFile(StartLoc, NestedLoc)); in popRegions()
1067 assert(SM.isWrittenInSameFile(Region.getBeginLoc(), EndLoc)); in popRegions()
1068 assert(SpellingRegion(SM, Region).isInSourceOrder()); in popRegions()
1095 if (SM.isBeforeInTranslationUnit(StartLoc, S->getBeginLoc())) in propagateCounts()
1199 SM.isWrittenInSameFile(MostRecentLocation, NewLoc)) in handleFileExit()
1205 FileID ParentFile = SM.getFileID(LCA); in handleFileExit()
1208 if (LCA.isInvalid() || SM.isWrittenInSameFile(LCA, MostRecentLocation)) { in handleFileExit()
1214 ParentFile = SM.getFileID(LCA); in handleFileExit()
1228 while (!SM.isInFileID(Loc, ParentFile)) { in handleFileExit()
1256 assert(SpellingRegion(SM, SourceRegions.back()).isInSourceOrder()); in handleFileExit()
1298 FileID FID = SM.getFileID(AfterLoc); in findGapAreaBetween()
1299 const SrcMgr::ExpansionInfo *EI = &SM.getSLocEntry(FID).getExpansion(); in findGapAreaBetween()
1306 while (!SM.isWrittenInSameFile(AfterLoc, BeforeLoc)) { in findGapAreaBetween()
1310 assert(SM.isWrittenInSameFile(getStartOfFileOrMacro(BeforeLoc), in findGapAreaBetween()
1318 assert(SM.isWrittenInSameFile(AfterLoc, in findGapAreaBetween()
1333 if (!SM.isWrittenInSameFile(AfterLoc, BeforeLoc) || in findGapAreaBetween()
1334 !SpellingRegion(SM, AfterLoc, BeforeLoc).isInSourceOrder()) in findGapAreaBetween()
1344 assert(SpellingRegion(SM, StartLoc, EndLoc).isInSourceOrder()); in fillGapAreaWithCount()
1358 FileID FID = SM.getFileID(StartingLoc); in findAreaStartingFromTo()
1359 const SrcMgr::ExpansionInfo *EI = &SM.getSLocEntry(FID).getExpansion(); in findAreaStartingFromTo()
1366 while (!SM.isWrittenInSameFile(StartingLoc, BeforeLoc)) { in findAreaStartingFromTo()
1370 assert(SM.isWrittenInSameFile(getStartOfFileOrMacro(BeforeLoc), in findAreaStartingFromTo()
1378 assert(SM.isWrittenInSameFile(StartingLoc, in findAreaStartingFromTo()
1390 if (!SM.isWrittenInSameFile(StartingLoc, BeforeLoc) || in findAreaStartingFromTo()
1391 !SpellingRegion(SM, StartingLoc, BeforeLoc).isInSourceOrder()) in findAreaStartingFromTo()
1407 assert(SpellingRegion(SM, NewStartLoc, EndLoc).isInSourceOrder()); in markSkipped()
1425 MCDC::State &MCDCState, SourceManager &SM, const LangOptions &LangOpts) in CounterCoverageMappingBuilder()
1426 : CoverageMappingBuilder(CVM, SM, LangOpts), CounterMap(CounterMap), in CounterCoverageMappingBuilder()
1478 SM.isInSystemHeader(SM.getSpellingLoc(getStart(Body)))) in VisitDecl()
2207 SM.isInSystemHeader(SM.getSpellingLoc(E->getOperatorLoc())) && in isExprInSystemHeader()
2208 SM.isInSystemHeader(SM.getSpellingLoc(E->getBeginLoc())) && in isExprInSystemHeader()
2209 SM.isInSystemHeader(SM.getSpellingLoc(E->getEndLoc()))); in isExprInSystemHeader()
2609 CounterCoverageMappingBuilder Walker(CVM, *CounterMap, *MCDCState, SM, in emitCounterMapping()
2617 EmptyCoverageMappingBuilder Walker(CVM, SM, LangOpts); in emitEmptyMapping()