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