Lines Matching refs:File

215   FileID File;  in range()  local
217 std::tie(File, StartOffset) = SM.getDecomposedLoc(location()); in range()
218 return FileRange(File, StartOffset, StartOffset + length()); in range()
236 FileRange::FileRange(FileID File, unsigned BeginOffset, unsigned EndOffset) in FileRange() argument
237 : File(File), Begin(BeginOffset), End(EndOffset) { in FileRange()
238 assert(File.isValid()); in FileRange()
247 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
259 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
272 StringRef Text = SM.getBufferData(File, &Invalid); in text()
318 SourceRange(SM.getComposedLoc(File, Begin), SM.getComposedLoc(File, End)), in toCharRange()
332 const MarkedFile &File = FileIt->second; in spelledForExpandedToken() local
336 auto It = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in spelledForExpandedToken()
340 if (It == File.Mappings.begin()) { in spelledForExpandedToken()
342 return {&File.SpelledTokens[ExpandedIndex - File.BeginExpanded], in spelledForExpandedToken()
349 return {&File.SpelledTokens[It->BeginSpelled], /*Mapping=*/&*It}; in spelledForExpandedToken()
354 &File.SpelledTokens[It->EndSpelled + (ExpandedIndex - It->EndExpanded)], in spelledForExpandedToken()
378 const auto &File = fileForSpelled(Spelled); in expandedForSpelled() local
380 auto *FrontMapping = mappingStartingBeforeSpelled(File, &Spelled.front()); in expandedForSpelled()
381 unsigned SpelledFrontI = &Spelled.front() - File.SpelledTokens.data(); in expandedForSpelled()
382 assert(SpelledFrontI < File.SpelledTokens.size()); in expandedForSpelled()
387 ExpandedBegin = File.BeginExpanded + SpelledFrontI; in expandedForSpelled()
403 auto *BackMapping = mappingStartingBeforeSpelled(File, &Spelled.back()); in expandedForSpelled()
404 unsigned SpelledBackI = &Spelled.back() - File.SpelledTokens.data(); in expandedForSpelled()
409 ExpandedEnd = File.BeginExpanded + SpelledBackI + 1; in expandedForSpelled()
470 const MarkedFile &File = Files.find(FID)->second; in spelledForExpanded() local
488 return getTokensCovering(File.SpelledTokens, Range, *SourceMgr); in spelledForExpanded()
500 FirstMapping ? File.SpelledTokens.data() + FirstMapping->BeginSpelled in spelledForExpanded()
502 LastMapping ? File.SpelledTokens.data() + LastMapping->EndSpelled in spelledForExpanded()
522 const auto &File = FileIt->second; in fileForSpelled() local
523 assert(File.SpelledTokens.data() <= Spelled.data() && in fileForSpelled()
525 (File.SpelledTokens.data() + File.SpelledTokens.size()) && in fileForSpelled()
529 auto T2 = File.SpelledTokens.back().location(); in fileForSpelled()
532 return File; in fileForSpelled()
538 const auto &File = fileForSpelled(*Spelled); in expansionStartingAt() local
540 unsigned SpelledIndex = Spelled - File.SpelledTokens.data(); in expansionStartingAt()
541 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionStartingAt()
544 if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex) in expansionStartingAt()
546 return makeExpansion(File, *M); in expansionStartingAt()
553 const auto &File = fileForSpelled(Spelled); in expansionsOverlapping() local
556 unsigned SpelledBeginIndex = Spelled.begin() - File.SpelledTokens.data(); in expansionsOverlapping()
557 unsigned SpelledEndIndex = Spelled.end() - File.SpelledTokens.data(); in expansionsOverlapping()
558 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionsOverlapping()
562 for (; M != File.Mappings.end() && M->BeginSpelled < SpelledEndIndex; ++M) in expansionsOverlapping()
563 Expansions.push_back(makeExpansion(File, *M)); in expansionsOverlapping()
609 auto &File = FileIt->second; in macroExpansions() local
611 auto &Spelled = File.SpelledTokens; in macroExpansions()
612 for (auto Mapping : File.Mappings) { in macroExpansions()
784 for (const auto &File : Result.Files) in build() local
785 discard(File.first); in build()
813 FileID File = SM.getFileID(Target); in discard() local
814 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in discard()
815 auto &NextSpelled = this->NextSpelled[File]; in discard()
828 Result.Files[File].Mappings.push_back(Mapping); in discard()
859 FileID File = SM.getFileID(Expansion); in advance() local
860 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in advance()
861 auto &NextSpelled = this->NextSpelled[File]; in advance()
894 Result.Files[File].Mappings.push_back(Mapping); in advance()
919 TokenBuffer::MarkedFile &File = It.first->second; in buildSpelledTokens() local
922 File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; in buildSpelledTokens()
927 File.BeginExpanded = I; in buildSpelledTokens()
928 File.SpelledTokens = tokenize(FID, SM, LangOpts); in buildSpelledTokens()
994 const MarkedFile &File = Files.find(ID)->second; in dumpForTests() local
1001 DumpTokens(OS, File.SpelledTokens); in dumpForTests()
1004 if (File.Mappings.empty()) { in dumpForTests()
1009 for (auto &M : File.Mappings) { in dumpForTests()
1012 PrintToken(File.SpelledTokens[M.BeginSpelled]), M.BeginSpelled, in dumpForTests()
1013 M.EndSpelled == File.SpelledTokens.size() in dumpForTests()
1015 : PrintToken(File.SpelledTokens[M.EndSpelled]), in dumpForTests()