Lines Matching refs:File
121 FileID File; in range() local
123 std::tie(File, StartOffset) = SM.getDecomposedLoc(location()); in range()
124 return FileRange(File, StartOffset, StartOffset + length()); in range()
142 FileRange::FileRange(FileID File, unsigned BeginOffset, unsigned EndOffset) in FileRange() argument
143 : File(File), Begin(BeginOffset), End(EndOffset) { in FileRange()
144 assert(File.isValid()); in FileRange()
153 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
165 std::tie(File, Begin) = SM.getDecomposedLoc(BeginLoc); in FileRange()
178 StringRef Text = SM.getBufferData(File, &Invalid); in text()
224 SourceRange(SM.getComposedLoc(File, Begin), SM.getComposedLoc(File, End)), in toCharRange()
238 const MarkedFile &File = FileIt->second; in spelledForExpandedToken() local
242 auto It = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in spelledForExpandedToken()
246 if (It == File.Mappings.begin()) { in spelledForExpandedToken()
248 return {&File.SpelledTokens[ExpandedIndex - File.BeginExpanded], in spelledForExpandedToken()
255 return {&File.SpelledTokens[It->BeginSpelled], /*Mapping=*/&*It}; in spelledForExpandedToken()
260 &File.SpelledTokens[It->EndSpelled + (ExpandedIndex - It->EndExpanded)], in spelledForExpandedToken()
284 const auto &File = fileForSpelled(Spelled); in expandedForSpelled() local
286 auto *FrontMapping = mappingStartingBeforeSpelled(File, &Spelled.front()); in expandedForSpelled()
287 unsigned SpelledFrontI = &Spelled.front() - File.SpelledTokens.data(); in expandedForSpelled()
288 assert(SpelledFrontI < File.SpelledTokens.size()); in expandedForSpelled()
293 ExpandedBegin = File.BeginExpanded + SpelledFrontI; in expandedForSpelled()
309 auto *BackMapping = mappingStartingBeforeSpelled(File, &Spelled.back()); in expandedForSpelled()
310 unsigned SpelledBackI = &Spelled.back() - File.SpelledTokens.data(); in expandedForSpelled()
315 ExpandedEnd = File.BeginExpanded + SpelledBackI + 1; in expandedForSpelled()
382 const MarkedFile &File = Files.find(FID)->second; in spelledForExpanded() local
397 return getTokensCovering(File.SpelledTokens, CommonRange, *SourceMgr); in spelledForExpanded()
409 BeginMapping ? File.SpelledTokens.data() + BeginMapping->BeginSpelled in spelledForExpanded()
411 LastMapping ? File.SpelledTokens.data() + LastMapping->EndSpelled in spelledForExpanded()
431 const auto &File = FileIt->second; in fileForSpelled() local
432 assert(File.SpelledTokens.data() <= Spelled.data() && in fileForSpelled()
434 (File.SpelledTokens.data() + File.SpelledTokens.size()) && in fileForSpelled()
438 auto T2 = File.SpelledTokens.back().location(); in fileForSpelled()
441 return File; in fileForSpelled()
447 const auto &File = fileForSpelled(*Spelled); in expansionStartingAt() local
449 unsigned SpelledIndex = Spelled - File.SpelledTokens.data(); in expansionStartingAt()
450 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionStartingAt()
453 if (M == File.Mappings.end() || M->BeginSpelled != SpelledIndex) in expansionStartingAt()
455 return makeExpansion(File, *M); in expansionStartingAt()
462 const auto &File = fileForSpelled(Spelled); in expansionsOverlapping() local
465 unsigned SpelledBeginIndex = Spelled.begin() - File.SpelledTokens.data(); in expansionsOverlapping()
466 unsigned SpelledEndIndex = Spelled.end() - File.SpelledTokens.data(); in expansionsOverlapping()
467 auto M = llvm::partition_point(File.Mappings, [&](const Mapping &M) { in expansionsOverlapping()
471 for (; M != File.Mappings.end() && M->BeginSpelled < SpelledEndIndex; ++M) in expansionsOverlapping()
472 Expansions.push_back(makeExpansion(File, *M)); in expansionsOverlapping()
518 auto &File = FileIt->second; in macroExpansions() local
520 auto &Spelled = File.SpelledTokens; in macroExpansions()
521 for (auto Mapping : File.Mappings) { in macroExpansions()
693 for (const auto &File : Result.Files) in build() local
694 discard(File.first); in build()
722 FileID File = SM.getFileID(Target); in discard() local
723 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in discard()
724 auto &NextSpelled = this->NextSpelled[File]; in discard()
737 Result.Files[File].Mappings.push_back(Mapping); in discard()
768 FileID File = SM.getFileID(Expansion); in advance() local
769 const auto &SpelledTokens = Result.Files[File].SpelledTokens; in advance()
770 auto &NextSpelled = this->NextSpelled[File]; in advance()
803 Result.Files[File].Mappings.push_back(Mapping); in advance()
828 TokenBuffer::MarkedFile &File = It.first->second; in buildSpelledTokens() local
831 File.EndExpanded = Tok.kind() == tok::eof ? I : I + 1; in buildSpelledTokens()
836 File.BeginExpanded = I; in buildSpelledTokens()
837 File.SpelledTokens = tokenize(FID, SM, LangOpts); in buildSpelledTokens()
903 const MarkedFile &File = Files.find(ID)->second; in dumpForTests() local
910 DumpTokens(OS, File.SpelledTokens); in dumpForTests()
913 if (File.Mappings.empty()) { in dumpForTests()
918 for (auto &M : File.Mappings) { in dumpForTests()
921 PrintToken(File.SpelledTokens[M.BeginSpelled]), M.BeginSpelled, in dumpForTests()
922 M.EndSpelled == File.SpelledTokens.size() in dumpForTests()
924 : PrintToken(File.SpelledTokens[M.EndSpelled]), in dumpForTests()