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()
424 const MarkedFile &File = Files.find(FID)->second; in spelledForExpanded() local
442 return getTokensCovering(File.SpelledTokens, Range, *SourceMgr); in spelledForExpanded()
454 FirstMapping ? File.SpelledTokens.data() + FirstMapping->BeginSpelled in spelledForExpanded()
456 LastMapping ? File.SpelledTokens.data() + LastMapping->EndSpelled in spelledForExpanded()
476 const auto &File = FileIt->second; in fileForSpelled() local
477 assert(File.SpelledTokens.data() <= Spelled.data() && in fileForSpelled()
479 (File.SpelledTokens.data() + File.SpelledTokens.size()) && in fileForSpelled()
483 auto T2 = File.SpelledTokens.back().location(); in fileForSpelled()
486 return File; in fileForSpelled()
492 const auto &File = fileForSpelled(*Spelled); in expansionStartingAt() local
494 unsigned SpelledIndex = Spelled - File.SpelledTokens.data(); in expansionStartingAt()
495 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionStartingAt()
498 if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex) in expansionStartingAt()
500 return makeExpansion(File, *M); in expansionStartingAt()
507 const auto &File = fileForSpelled(Spelled); in expansionsOverlapping() local
510 unsigned SpelledBeginIndex = Spelled.begin() - File.SpelledTokens.data(); in expansionsOverlapping()
511 unsigned SpelledEndIndex = Spelled.end() - File.SpelledTokens.data(); in expansionsOverlapping()
512 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionsOverlapping()
516 for (; M != File.Mappings.end() && M->BeginSpelled < SpelledEndIndex; ++M) in expansionsOverlapping()
517 Expansions.push_back(makeExpansion(File, *M)); in expansionsOverlapping()
563 auto &File = FileIt->second; in macroExpansions() local
565 auto &Spelled = File.SpelledTokens; in macroExpansions()
566 for (auto Mapping : File.Mappings) { in macroExpansions()
738 for (const auto &File : Result.Files) in build() local
739 discard(File.first); in build()
767 FileID File = SM.getFileID(Target); in discard() local
768 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in discard()
769 auto &NextSpelled = this->NextSpelled[File]; in discard()
782 Result.Files[File].Mappings.push_back(Mapping); in discard()
813 FileID File = SM.getFileID(Expansion); in advance() local
814 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in advance()
815 auto &NextSpelled = this->NextSpelled[File]; in advance()
848 Result.Files[File].Mappings.push_back(Mapping); in advance()
873 TokenBuffer::MarkedFile &File = It.first->second; in buildSpelledTokens() local
876 File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; in buildSpelledTokens()
881 File.BeginExpanded = I; in buildSpelledTokens()
882 File.SpelledTokens = tokenize(FID, SM, LangOpts); in buildSpelledTokens()
948 const MarkedFile &File = Files.find(ID)->second; in dumpForTests() local
955 DumpTokens(OS, File.SpelledTokens); in dumpForTests()
958 if (File.Mappings.empty()) { in dumpForTests()
963 for (auto &M : File.Mappings) { in dumpForTests()
966 PrintToken(File.SpelledTokens[M.BeginSpelled]), M.BeginSpelled, in dumpForTests()
967 M.EndSpelled == File.SpelledTokens.size() in dumpForTests()
969 : PrintToken(File.SpelledTokens[M.EndSpelled]), in dumpForTests()