Lines Matching refs:File

163   FileID File;  in range()  local
165 std::tie(File, StartOffset) = SM.getDecomposedLoc(location()); in range()
166 return FileRange(File, StartOffset, StartOffset + length()); in range()
184 FileRange::FileRange(FileID File, unsigned BeginOffset, unsigned EndOffset) in FileRange() argument
185 : File(File), Begin(BeginOffset), End(EndOffset) { in FileRange()
186 assert(File.isValid()); in FileRange()
195 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
207 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
220 StringRef Text = SM.getBufferData(File, &Invalid); in text()
266 SourceRange(SM.getComposedLoc(File, Begin), SM.getComposedLoc(File, End)), in toCharRange()
280 const MarkedFile &File = FileIt->second; in spelledForExpandedToken() local
284 auto It = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in spelledForExpandedToken()
288 if (It == File.Mappings.begin()) { in spelledForExpandedToken()
290 return {&File.SpelledTokens[ExpandedIndex - File.BeginExpanded], in spelledForExpandedToken()
297 return {&File.SpelledTokens[It->BeginSpelled], /*Mapping=*/&*It}; in spelledForExpandedToken()
302 &File.SpelledTokens[It->EndSpelled + (ExpandedIndex - It->EndExpanded)], in spelledForExpandedToken()
326 const auto &File = fileForSpelled(Spelled); in expandedForSpelled() local
328 auto *FrontMapping = mappingStartingBeforeSpelled(File, &Spelled.front()); in expandedForSpelled()
329 unsigned SpelledFrontI = &Spelled.front() - File.SpelledTokens.data(); in expandedForSpelled()
330 assert(SpelledFrontI < File.SpelledTokens.size()); in expandedForSpelled()
335 ExpandedBegin = File.BeginExpanded + SpelledFrontI; in expandedForSpelled()
351 auto *BackMapping = mappingStartingBeforeSpelled(File, &Spelled.back()); in expandedForSpelled()
352 unsigned SpelledBackI = &Spelled.back() - File.SpelledTokens.data(); in expandedForSpelled()
357 ExpandedEnd = File.BeginExpanded + SpelledBackI + 1; in expandedForSpelled()
425 const MarkedFile &File = Files.find(FID)->second; in spelledForExpanded() local
443 return getTokensCovering(File.SpelledTokens, Range, *SourceMgr); in spelledForExpanded()
455 FirstMapping ? File.SpelledTokens.data() + FirstMapping->BeginSpelled in spelledForExpanded()
457 LastMapping ? File.SpelledTokens.data() + LastMapping->EndSpelled in spelledForExpanded()
477 const auto &File = FileIt->second; in fileForSpelled() local
478 assert(File.SpelledTokens.data() <= Spelled.data() && in fileForSpelled()
480 (File.SpelledTokens.data() + File.SpelledTokens.size()) && in fileForSpelled()
484 auto T2 = File.SpelledTokens.back().location(); in fileForSpelled()
487 return File; in fileForSpelled()
493 const auto &File = fileForSpelled(*Spelled); in expansionStartingAt() local
495 unsigned SpelledIndex = Spelled - File.SpelledTokens.data(); in expansionStartingAt()
496 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionStartingAt()
499 if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex) in expansionStartingAt()
501 return makeExpansion(File, *M); in expansionStartingAt()
508 const auto &File = fileForSpelled(Spelled); in expansionsOverlapping() local
511 unsigned SpelledBeginIndex = Spelled.begin() - File.SpelledTokens.data(); in expansionsOverlapping()
512 unsigned SpelledEndIndex = Spelled.end() - File.SpelledTokens.data(); in expansionsOverlapping()
513 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionsOverlapping()
517 for (; M != File.Mappings.end() && M->BeginSpelled < SpelledEndIndex; ++M) in expansionsOverlapping()
518 Expansions.push_back(makeExpansion(File, *M)); in expansionsOverlapping()
564 auto &File = FileIt->second; in macroExpansions() local
566 auto &Spelled = File.SpelledTokens; in macroExpansions()
567 for (auto Mapping : File.Mappings) { in macroExpansions()
739 for (const auto &File : Result.Files) in build() local
740 discard(File.first); in build()
768 FileID File = SM.getFileID(Target); in discard() local
769 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in discard()
770 auto &NextSpelled = this->NextSpelled[File]; in discard()
783 Result.Files[File].Mappings.push_back(Mapping); in discard()
814 FileID File = SM.getFileID(Expansion); in advance() local
815 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in advance()
816 auto &NextSpelled = this->NextSpelled[File]; in advance()
849 Result.Files[File].Mappings.push_back(Mapping); in advance()
874 TokenBuffer::MarkedFile &File = It.first->second; in buildSpelledTokens() local
877 File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; in buildSpelledTokens()
882 File.BeginExpanded = I; in buildSpelledTokens()
883 File.SpelledTokens = tokenize(FID, SM, LangOpts); in buildSpelledTokens()
949 const MarkedFile &File = Files.find(ID)->second; in dumpForTests() local
956 DumpTokens(OS, File.SpelledTokens); in dumpForTests()
959 if (File.Mappings.empty()) { in dumpForTests()
964 for (auto &M : File.Mappings) { in dumpForTests()
967 PrintToken(File.SpelledTokens[M.BeginSpelled]), M.BeginSpelled, in dumpForTests()
968 M.EndSpelled == File.SpelledTokens.size() in dumpForTests()
970 : PrintToken(File.SpelledTokens[M.EndSpelled]), in dumpForTests()