Lines Matching defs:SM

41                   const SourceManager &SM) {
46 return SM.isBeforeInTranslationUnit(T.location(), R.getBegin());
50 return !SM.isBeforeInTranslationUnit(R.getEnd(), T.location());
69 const SourceManager &SM) {
77 assert(SM.getSLocEntry(TargetFile).isFile());
89 auto DecFirst = SM.getDecomposedLoc(First);
90 auto DecLast = SM.getDecomposedLoc(Last);
91 auto &ExpFirst = SM.getSLocEntry(DecFirst.first).getExpansion();
92 auto &ExpLast = SM.getSLocEntry(DecLast.first).getExpansion();
106 auto ExpFileID = SM.getFileID(ExpFirst.getExpansionLocStart());
118 SM.getExpansionRange(SourceRange(First, Last)).getAsRange();
119 auto DecFirst = SM.getDecomposedExpansionLoc(Candidate.getBegin());
120 auto DecLast = SM.getDecomposedExpansionLoc(Candidate.getEnd());
127 auto Dec = SM.getDecomposedLoc(SM.getExpansionRange(Prev).getBegin());
132 auto Dec = SM.getDecomposedLoc(SM.getExpansionRange(Next).getEnd());
154 llvm::StringRef syntax::Token::text(const SourceManager &SM) const {
156 const char *Start = SM.getCharacterData(location(), &Invalid);
161 FileRange syntax::Token::range(const SourceManager &SM) const {
165 std::tie(File, StartOffset) = SM.getDecomposedLoc(location());
169 FileRange syntax::Token::range(const SourceManager &SM,
172 auto F = First.range(SM);
173 auto L = Last.range(SM);
190 FileRange::FileRange(const SourceManager &SM, SourceLocation BeginLoc,
195 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc);
198 FileRange::FileRange(const SourceManager &SM, SourceLocation BeginLoc,
204 assert(SM.getFileID(BeginLoc) == SM.getFileID(EndLoc));
205 assert(SM.getFileOffset(BeginLoc) <= SM.getFileOffset(EndLoc));
207 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc);
208 End = SM.getFileOffset(EndLoc);
218 llvm::StringRef FileRange::text(const SourceManager &SM) const {
220 StringRef Text = SM.getBufferData(File, &Invalid);
264 CharSourceRange FileRange::toCharRange(const SourceManager &SM) const {
266 SourceRange(SM.getComposedLoc(File, Begin), SM.getComposedLoc(File, End)),
576 const SourceManager &SM,
591 auto SrcBuffer = SM.getBufferData(FR.file());
592 Lexer L(SM.getLocForStartOfFile(FR.file()), LO, SrcBuffer.data(),
603 if (SM.getFileOffset(T.getLocation()) < FR.endOffset())
608 std::vector<syntax::Token> syntax::tokenize(FileID FID, const SourceManager &SM,
610 return tokenize(syntax::FileRange(FID, 0, SM.getFileIDSize(FID)), SM, LO);
628 const auto &SM = Collector->PP.getSourceManager();
648 !SM.isBeforeInTranslationUnit(LastExpansionEnd, Range.getEnd()))
655 Range.setBegin(SM.getExpansionLoc(Range.getBegin()));
709 const SourceManager &SM, const LangOptions &LangOpts)
710 : Result(SM), CollectedExpansions(std::move(CollectedExpansions)), SM(SM),
765 Drain ? SM.getLocForEndOfFile(*Drain)
766 : SM.getExpansionLoc(
768 FileID File = SM.getFileID(Target);
813 SourceLocation Expansion = SM.getExpansionLoc(Tok.location());
814 FileID File = SM.getFileID(Expansion);
843 SM.getExpansionLoc(
861 llvm::errs() << L << Result.ExpandedTokens[I].dumpForTests(SM) << "\n";
872 auto FID = SM.getFileID(SM.getExpansionLoc(Tok.location()));
883 File.SpelledTokens = tokenize(FID, SM, LangOpts);
891 const SourceManager &SM;
908 std::string syntax::Token::dumpForTests(const SourceManager &SM) const {
909 return std::string(llvm::formatv("Token(`{0}`, {1}, length = {2})", text(SM),