Lines Matching refs:SM

54                                           const SourceManager &SM,  in validateRange()  argument
65 if (SM.isInSystemHeader(Range.getBegin()) || in validateRange()
66 SM.isInSystemHeader(Range.getEnd())) in validateRange()
71 std::pair<FileID, unsigned> BeginInfo = SM.getDecomposedLoc(Range.getBegin()); in validateRange()
72 std::pair<FileID, unsigned> EndInfo = SM.getDecomposedLoc(Range.getEnd()); in validateRange()
85 const SourceManager &SM) { in validateEditRange() argument
86 return validateRange(Range, SM, /*AllowSystemHeaders=*/false); in validateEditRange()
90 const SourceManager &SM) { in spelledInMacroDefinition() argument
92 const auto &Expansion = SM.getSLocEntry(SM.getFileID(Loc)).getExpansion(); in spelledInMacroDefinition()
108 getExpansionForSplitToken(SourceLocation Loc, const SourceManager &SM, in getExpansionForSplitToken() argument
112 auto &SLoc = SM.getSLocEntry(SM.getFileID(Loc), &Invalid); in getExpansionForSplitToken()
129 const SourceManager &SM, in getRangeForSplitTokens() argument
132 auto BeginToken = getExpansionForSplitToken(Range.getBegin(), SM, LangOpts); in getRangeForSplitTokens()
133 auto EndToken = getExpansionForSplitToken(Range.getEnd(), SM, LangOpts); in getRangeForSplitTokens()
153 const SourceManager &SM, in getRange() argument
158 Range = Lexer::makeFileCharRange(EditRange, SM, LangOpts); in getRange()
160 auto AdjustedRange = getRangeForSplitTokens(EditRange, SM, LangOpts); in getRange()
161 if (spelledInMacroDefinition(AdjustedRange.getBegin(), SM) || in getRange()
162 spelledInMacroDefinition(AdjustedRange.getEnd(), SM)) in getRange()
165 auto B = SM.getSpellingLoc(AdjustedRange.getBegin()); in getRange()
166 auto E = SM.getSpellingLoc(AdjustedRange.getEnd()); in getRange()
168 E = Lexer::getLocForEndOfToken(E, 0, SM, LangOpts); in getRange()
175 const CharSourceRange &EditRange, const SourceManager &SM, in getFileRangeForEdit() argument
178 getRange(EditRange, SM, LangOpts, IncludeMacroExpansion); in getFileRangeForEdit()
179 bool IsInvalid = llvm::errorToBool(validateEditRange(Range, SM)); in getFileRangeForEdit()
186 const CharSourceRange &EditRange, const SourceManager &SM, in getFileRange() argument
189 getRange(EditRange, SM, LangOpts, IncludeMacroExpansion); in getFileRange()
191 llvm::errorToBool(validateRange(Range, SM, /*AllowSystemHeaders=*/true)); in getFileRange()
197 static bool startsWithNewline(const SourceManager &SM, const Token &Tok) { in startsWithNewline() argument
198 return isVerticalWhitespace(SM.getCharacterData(Tok.getLocation())[0]); in startsWithNewline()
215 getEntityEndLoc(const SourceManager &SM, SourceLocation EntityLast, in getEntityEndLoc() argument
225 CharSourceRange ExpansionRange = SM.getExpansionRange(EntityLast); in getEntityEndLoc()
230 auto FileOffset = SM.getDecomposedLoc(ExpansionRange.getEnd()); in getEntityEndLoc()
231 llvm::StringRef File = SM.getBufferData(FileOffset.first, &Invalid); in getEntityEndLoc()
234 SM.getLocForStartOfFile(FileOffset.first), LangOpts, File.begin(), in getEntityEndLoc()
295 if (startsWithNewline(SM, Tok)) in getEntityEndLoc()
313 if (startsWithNewline(SM, Tok)) in getEntityEndLoc()
360 static SourceLocation skipWhitespaceAndNewline(const SourceManager &SM, in skipWhitespaceAndNewline() argument
363 const char *LocChars = SM.getCharacterData(Loc); in skipWhitespaceAndNewline()
376 static bool atOrBeforeSeparation(const SourceManager &SM, SourceLocation Loc, in atOrBeforeSeparation() argument
384 SM.getCharacterData(Loc.getLocWithOffset(-1), &Invalid); in atOrBeforeSeparation()
395 bool Failed = Lexer::getRawToken(Loc, Tok, SM, LangOpts, in atOrBeforeSeparation()
414 const SourceManager &SM = Context.getSourceManager(); in getAssociatedRange() local
421 if (SM.isBeforeInTranslationUnit(T->getBeginLoc(), Range.getBegin())) in getAssociatedRange()
425 if (SM.isBeforeInTranslationUnit(T->getBeginLoc(), Range.getBegin())) in getAssociatedRange()
432 getEntityEndLoc(SM, Decl.getEndLoc(), getTerminators(Decl), LangOpts)); in getAssociatedRange()
446 if (SM.isBeforeInTranslationUnit(Comment->getBeginLoc(), in getAssociatedRange()
449 SM, skipWhitespaceAndNewline(SM, Comment->getEndLoc(), LangOpts), in getAssociatedRange()
451 atOrBeforeSeparation(SM, Range.getEnd(), LangOpts)) { in getAssociatedRange()
452 const StringRef CommentText = Comment->getRawText(SM); in getAssociatedRange()
460 !SM.isBeforeInTranslationUnit(Attr->getLocation(), Range.getBegin())) in getAssociatedRange()
468 SM.getBufferData(SM.getFileID(Range.getBegin()), &Invalid); in getAssociatedRange()
472 Source.substr(0, SM.getFileOffset(Range.getBegin())); in getAssociatedRange()
493 return Lexer::makeFileCharRange(Range, SM, LangOpts); in getAssociatedRange()