Lines Matching refs:File
216 FileID File; in range() local
218 std::tie(File, StartOffset) = SM.getDecomposedLoc(location()); in range()
219 return FileRange(File, StartOffset, StartOffset + length()); in range()
237 FileRange::FileRange(FileID File, unsigned BeginOffset, unsigned EndOffset) in FileRange() argument
238 : File(File), Begin(BeginOffset), End(EndOffset) { in FileRange()
239 assert(File.isValid()); in FileRange()
248 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
260 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
273 StringRef Text = SM.getBufferData(File, &Invalid); in text()
319 SourceRange(SM.getComposedLoc(File, Begin), SM.getComposedLoc(File, End)), in toCharRange()
333 const MarkedFile &File = FileIt->second; in spelledForExpandedToken() local
337 auto It = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in spelledForExpandedToken()
341 if (It == File.Mappings.begin()) { in spelledForExpandedToken()
343 return {&File.SpelledTokens[ExpandedIndex - File.BeginExpanded], in spelledForExpandedToken()
350 return {&File.SpelledTokens[It->BeginSpelled], /*Mapping=*/&*It}; in spelledForExpandedToken()
355 &File.SpelledTokens[It->EndSpelled + (ExpandedIndex - It->EndExpanded)], in spelledForExpandedToken()
379 const auto &File = fileForSpelled(Spelled); in expandedForSpelled() local
381 auto *FrontMapping = mappingStartingBeforeSpelled(File, &Spelled.front()); in expandedForSpelled()
382 unsigned SpelledFrontI = &Spelled.front() - File.SpelledTokens.data(); in expandedForSpelled()
383 assert(SpelledFrontI < File.SpelledTokens.size()); in expandedForSpelled()
388 ExpandedBegin = File.BeginExpanded + SpelledFrontI; in expandedForSpelled()
404 auto *BackMapping = mappingStartingBeforeSpelled(File, &Spelled.back()); in expandedForSpelled()
405 unsigned SpelledBackI = &Spelled.back() - File.SpelledTokens.data(); in expandedForSpelled()
410 ExpandedEnd = File.BeginExpanded + SpelledBackI + 1; in expandedForSpelled()
473 const MarkedFile &File = Files.find(FID)->second; in spelledForExpanded() local
491 return getTokensCovering(File.SpelledTokens, Range, *SourceMgr); in spelledForExpanded()
503 FirstMapping ? File.SpelledTokens.data() + FirstMapping->BeginSpelled in spelledForExpanded()
505 LastMapping ? File.SpelledTokens.data() + LastMapping->EndSpelled in spelledForExpanded()
525 const auto &File = FileIt->second; in fileForSpelled() local
526 assert(File.SpelledTokens.data() <= Spelled.data() && in fileForSpelled()
528 (File.SpelledTokens.data() + File.SpelledTokens.size()) && in fileForSpelled()
532 auto T2 = File.SpelledTokens.back().location(); in fileForSpelled()
535 return File; in fileForSpelled()
541 const auto &File = fileForSpelled(*Spelled); in expansionStartingAt() local
543 unsigned SpelledIndex = Spelled - File.SpelledTokens.data(); in expansionStartingAt()
544 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionStartingAt()
547 if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex) in expansionStartingAt()
549 return makeExpansion(File, *M); in expansionStartingAt()
556 const auto &File = fileForSpelled(Spelled); in expansionsOverlapping() local
559 unsigned SpelledBeginIndex = Spelled.begin() - File.SpelledTokens.data(); in expansionsOverlapping()
560 unsigned SpelledEndIndex = Spelled.end() - File.SpelledTokens.data(); in expansionsOverlapping()
561 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionsOverlapping()
565 for (; M != File.Mappings.end() && M->BeginSpelled < SpelledEndIndex; ++M) in expansionsOverlapping()
566 Expansions.push_back(makeExpansion(File, *M)); in expansionsOverlapping()
612 auto &File = FileIt->second; in macroExpansions() local
614 auto &Spelled = File.SpelledTokens; in macroExpansions()
615 for (auto Mapping : File.Mappings) { in macroExpansions()
787 for (const auto &File : Result.Files) in build() local
788 discard(File.first); in build()
816 FileID File = SM.getFileID(Target); in discard() local
817 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in discard()
818 auto &NextSpelled = this->NextSpelled[File]; in discard()
831 Result.Files[File].Mappings.push_back(Mapping); in discard()
862 FileID File = SM.getFileID(Expansion); in advance() local
863 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in advance()
864 auto &NextSpelled = this->NextSpelled[File]; in advance()
897 Result.Files[File].Mappings.push_back(Mapping); in advance()
922 TokenBuffer::MarkedFile &File = It.first->second; in buildSpelledTokens() local
925 File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; in buildSpelledTokens()
930 File.BeginExpanded = I; in buildSpelledTokens()
931 File.SpelledTokens = tokenize(FID, SM, LangOpts); in buildSpelledTokens()
997 const MarkedFile &File = Files.find(ID)->second; in dumpForTests() local
1004 DumpTokens(OS, File.SpelledTokens); in dumpForTests()
1007 if (File.Mappings.empty()) { in dumpForTests()
1012 for (auto &M : File.Mappings) { in dumpForTests()
1015 PrintToken(File.SpelledTokens[M.BeginSpelled]), M.BeginSpelled, in dumpForTests()
1016 M.EndSpelled == File.SpelledTokens.size() in dumpForTests()
1018 : PrintToken(File.SpelledTokens[M.EndSpelled]), in dumpForTests()