Lines Matching refs:SM

41                   const SourceManager &SM) {  in getTokensCovering()  argument
46 return SM.isBeforeInTranslationUnit(T.location(), R.getBegin()); in getTokensCovering()
50 return !SM.isBeforeInTranslationUnit(R.getEnd(), T.location()); in getTokensCovering()
69 const SourceManager &SM) { in spelledForExpandedSlow() argument
77 assert(SM.getSLocEntry(TargetFile).isFile()); in spelledForExpandedSlow()
89 auto DecFirst = SM.getDecomposedLoc(First); in spelledForExpandedSlow()
90 auto DecLast = SM.getDecomposedLoc(Last); in spelledForExpandedSlow()
91 auto &ExpFirst = SM.getSLocEntry(DecFirst.first).getExpansion(); in spelledForExpandedSlow()
92 auto &ExpLast = SM.getSLocEntry(DecLast.first).getExpansion(); in spelledForExpandedSlow()
106 auto ExpFileID = SM.getFileID(ExpFirst.getExpansionLocStart()); in spelledForExpandedSlow()
118 SM.getExpansionRange(SourceRange(First, Last)).getAsRange(); in spelledForExpandedSlow()
119 auto DecFirst = SM.getDecomposedExpansionLoc(Candidate.getBegin()); in spelledForExpandedSlow()
120 auto DecLast = SM.getDecomposedExpansionLoc(Candidate.getEnd()); in spelledForExpandedSlow()
127 auto Dec = SM.getDecomposedLoc(SM.getExpansionRange(Prev).getBegin()); in spelledForExpandedSlow()
132 auto Dec = SM.getDecomposedLoc(SM.getExpansionRange(Next).getEnd()); in spelledForExpandedSlow()
154 llvm::StringRef syntax::Token::text(const SourceManager &SM) const { in text()
156 const char *Start = SM.getCharacterData(location(), &Invalid); in text()
161 FileRange syntax::Token::range(const SourceManager &SM) const { in range()
165 std::tie(File, StartOffset) = SM.getDecomposedLoc(location()); in range()
169 FileRange syntax::Token::range(const SourceManager &SM, in range() argument
172 auto F = First.range(SM); in range()
173 auto L = Last.range(SM); in range()
190 FileRange::FileRange(const SourceManager &SM, SourceLocation BeginLoc, in FileRange() argument
195 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
198 FileRange::FileRange(const SourceManager &SM, SourceLocation BeginLoc, in FileRange() argument
204 assert(SM.getFileID(BeginLoc) == SM.getFileID(EndLoc)); in FileRange()
205 assert(SM.getFileOffset(BeginLoc) <= SM.getFileOffset(EndLoc)); in FileRange()
207 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
208 End = SM.getFileOffset(EndLoc); in FileRange()
218 llvm::StringRef FileRange::text(const SourceManager &SM) const { in text()
220 StringRef Text = SM.getBufferData(File, &Invalid); in text()
264 CharSourceRange FileRange::toCharRange(const SourceManager &SM) const { in toCharRange()
266 SourceRange(SM.getComposedLoc(File, Begin), SM.getComposedLoc(File, End)), in toCharRange()
575 const SourceManager &SM, in tokenize() argument
590 auto SrcBuffer = SM.getBufferData(FR.file()); in tokenize()
591 Lexer L(SM.getLocForStartOfFile(FR.file()), LO, SrcBuffer.data(), in tokenize()
602 if (SM.getFileOffset(T.getLocation()) < FR.endOffset()) in tokenize()
607 std::vector<syntax::Token> syntax::tokenize(FileID FID, const SourceManager &SM, in tokenize() argument
609 return tokenize(syntax::FileRange(FID, 0, SM.getFileIDSize(FID)), SM, LO); in tokenize()
627 const auto &SM = Collector->PP.getSourceManager(); in MacroExpands() local
647 !SM.isBeforeInTranslationUnit(LastExpansionEnd, Range.getEnd())) in MacroExpands()
654 Range.setBegin(SM.getExpansionLoc(Range.getBegin())); in MacroExpands()
708 const SourceManager &SM, const LangOptions &LangOpts) in Builder() argument
709 : Result(SM), CollectedExpansions(std::move(CollectedExpansions)), SM(SM), in Builder()
764 Drain ? SM.getLocForEndOfFile(*Drain) in discard()
765 : SM.getExpansionLoc( in discard()
767 FileID File = SM.getFileID(Target); in discard()
812 SourceLocation Expansion = SM.getExpansionLoc(Tok.location()); in advance()
813 FileID File = SM.getFileID(Expansion); in advance()
842 SM.getExpansionLoc( in advance()
860 llvm::errs() << L << Result.ExpandedTokens[I].dumpForTests(SM) << "\n"; in diagnoseAdvanceFailure()
871 auto FID = SM.getFileID(SM.getExpansionLoc(Tok.location())); in buildSpelledTokens()
882 File.SpelledTokens = tokenize(FID, SM, LangOpts); in buildSpelledTokens()
890 const SourceManager &SM; member in TokenCollector::Builder
907 std::string syntax::Token::dumpForTests(const SourceManager &SM) const { in dumpForTests()
908 return std::string(llvm::formatv("Token(`{0}`, {1}, length = {2})", text(SM), in dumpForTests()