Home | History | Annotate | Download | only in Basic

Lines Matching refs:FileID

205 void LineTableInfo::AddLineNote(FileID FID, unsigned Offset, unsigned LineNo,
240 const LineEntry *LineTableInfo::FindNearestLineEntry(FileID FID,
259 void LineTableInfo::AddEntry(FileID FID,
269 /// AddLineNote - Add a line note to the line table for the FileID and offset
276 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
337 MainFileID = FileID();
341 LastLineNoFileIDQuery = FileID();
343 LastFileIDLookup = FileID();
348 // Use up FileID #0 as an invalid expansion.
487 /// Returns the previous in-order FileID or an invalid FileID if there
489 FileID SourceManager::getPreviousFileID(FileID FID) const {
491 return FileID();
495 return FileID();
499 return FileID();
501 return FileID();
504 return FileID::get(ID-1);
507 /// Returns the next in-order FileID or an invalid FileID if there is
509 FileID SourceManager::getNextFileID(FileID FID) const {
511 return FileID();
516 return FileID();
518 return FileID();
521 return FileID::get(ID+1);
525 // Methods to create new FileID's and macro expansions.
528 /// Create a new FileID that represents the specified file
532 FileID SourceManager::createFileID(const FileEntry *SourceFile,
540 FileID SourceManager::createFileID(FileEntryRef SourceFile,
556 /// Create a new FileID that represents the specified memory buffer.
560 FileID SourceManager::createFileID(std::unique_ptr<llvm::MemoryBuffer> Buffer,
569 /// Create a new FileID that represents the specified memory buffer.
573 FileID SourceManager::createFileID(const llvm::MemoryBufferRef &Buffer,
581 /// Get the FileID for \p SourceFile if it exists. Otherwise, create a
582 /// new FileID for the \p SourceFile.
583 FileID
586 FileID ID = translateFile(SourceFile);
591 /// createFileID - Create a new FileID for the specified ContentCache and
594 FileID SourceManager::createFileIDImpl(ContentCache &File, StringRef Filename,
599 assert(LoadedID != -1 && "Loading sentinel FileID");
601 assert(Index < LoadedSLocEntryTable.size() && "FileID out of range");
602 assert(!SLocEntryLoaded[Index] && "FileID already loaded");
606 return FileID::get(LoadedID);
612 return FileID();
623 FileID FID = FileID::get(LocalSLocEntryTable.size()-1);
665 assert(LoadedID != -1 && "Loading sentinel FileID");
667 assert(Index < LoadedSLocEntryTable.size() && "FileID out of range");
668 assert(!SLocEntryLoaded[Index] && "FileID already loaded");
727 SourceManager::getNonBuiltinFilenameForID(FileID FID) const {
734 StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const {
742 SourceManager::getBufferDataIfLoaded(FileID FID) const {
748 llvm::Optional<StringRef> SourceManager::getBufferDataOrNone(FileID FID) const {
760 /// Return the FileID for a SourceLocation.
765 FileID SourceManager::getFileIDSlow(unsigned SLocOffset) const {
767 return FileID::get(0);
776 /// Return the FileID for a SourceLocation with a low offset.
780 FileID SourceManager::getFileIDLocal(unsigned SLocOffset) const {
784 // behavior: 1) a lot of searched FileID's are "near" the cached file
793 // most newly created FileID.
805 // Find the FileID that contains this. "I" is an iterator that points to a
806 // FileID whose offset is known to be larger than SLocOffset.
811 FileID Res = FileID::get(int(I - LocalSLocEntryTable.begin()));
812 // Remember it. We have good locality across FileID lookups.
825 // We know that the offset corresponding to the FileID is is less than
845 FileID Res = FileID::get(MiddleIndex);
847 // Remember it. We have good locality across FileID lookups.
858 /// Return the FileID for a SourceLocation with a high offset.
862 FileID SourceManager::getFileIDLoaded(unsigned SLocOffset) const {
866 return FileID();
885 FileID Res = FileID::get(-int(I) - 2);
903 return FileID(); // invalid entry.
911 return FileID();
917 if (isOffsetInFileID(FileID::get(-int(MiddleIndex) - 2), SLocOffset)) {
918 FileID Res = FileID::get(-int(MiddleIndex) - 2);
927 return FileID();
950 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
968 std::pair<FileID, unsigned>
972 FileID FID;
986 std::pair<FileID, unsigned>
990 FileID FID;
1010 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
1061 FileID FID = getFileID(Loc);
1073 FileID FID = getFileID(Loc);
1082 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc);
1094 // For macro argument expansions, check if the previous FileID is part of
1097 FileID PrevFID = getPreviousFileID(DecompLoc.first);
1117 FileID FID = getFileID(Loc);
1129 // For macro argument expansions, check if the next FileID is part of the
1132 FileID NextFID = getNextFileID(FID);
1159 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(SL);
1181 unsigned SourceManager::getColumnNumber(FileID FID, unsigned FilePos,
1238 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1245 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1345 unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos,
1445 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1451 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1472 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1521 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1534 FileID FID = LocInfo.first;
1562 FID = FileID::get(0);
1596 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1615 unsigned SourceManager::getFileIDSize(FileID FID) const {
1628 NextOffset = getSLocEntry(FileID::get(ID+1)).getOffset();
1647 FileID FirstFID = translateFile(SourceFile);
1651 /// Get the FileID for the given file.
1653 /// If the source file is included multiple times, the FileID will be the
1655 FileID SourceManager::translateFile(const FileEntry *SourceFile) const {
1664 return FileID();
1678 return FileID::get(I);
1686 return FileID::get(-int(I) - 2);
1689 return FileID();
1694 SourceLocation SourceManager::translateLineCol(FileID FID,
1758 FileID FID) const {
1819 getFileIDSize(FileID::get(ID)));
1825 FileID FID,
1834 // consecutive FileID entries. Go through each entry contained in the
1838 FileID SpellFID; // Current FileID in the spelling range.
1859 return; // we covered all FileID entries in the spelling range.
1861 // Move to the next FileID entry in the spelling range.
1883 // and we found a new macro FileID that lexed from offset 105 with length 3,
1916 FileID FID;
1945 std::pair<FileID, unsigned>
1946 SourceManager::getDecomposedIncludedLoc(FileID FID) const {
1948 return std::make_pair(FileID(), 0);
1952 using DecompTy = std::pair<FileID, unsigned>;
1978 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc,
1980 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first);
1990 InBeforeInTUCacheEntry &SourceManager::getInBeforeInTUCache(FileID LFID,
1991 FileID RFID) const {
2023 std::pair<FileID, unsigned> LOffs = getDecomposedLoc(LHS);
2024 std::pair<FileID, unsigned> ROffs = getDecomposedLoc(RHS);
2026 // getDecomposedLoc may have failed to return a valid FileID because, e.g. it
2072 std::pair<FileID, unsigned> &LOffs,
2073 std::pair<FileID, unsigned> &ROffs) const {
2096 // We use a map from FileID to Offset to store the chain. Easier than writing
2098 using LocSet = llvm::SmallDenseMap<FileID, unsigned, 16>;
2149 llvm::errs() << "FileID scans: " << NumLinearScans << " linear, "
2158 out << "SLocEntry <FileID " << ID << "> " << (Entry.isFile() ? "file" : "expansion")
2167 out << " covers <FileID " << ID << ":" << int(ID + FI.NumCreatedFIDs)
2264 FileID ID = SourceMgr->createFileID(*FileMgr->getFile(FileName),