Lines Matching refs:SourceManager
1 //===- SourceManager.cpp - Track and cache source files -------------------===//
9 // This file implements the SourceManager interface.
13 #include "clang/Basic/SourceManager.h"
59 // SourceManager Helper Classes
262 unsigned SourceManager::getLineTableFilenameID(StringRef Name) {
269 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo,
297 LineTableInfo &SourceManager::getLineTable() {
307 SourceManager::SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr,
314 SourceManager::~SourceManager() {
332 void SourceManager::clearIDTables() {
352 bool SourceManager::isMainFile(const FileEntry &SourceFile) {
353 assert(MainFileID.isValid() && "expected initialized SourceManager");
359 void SourceManager::initializeForReplay(const SourceManager &Old) {
360 assert(MainFileID.isInvalid() && "expected uninitialized SourceManager");
387 ContentCache &SourceManager::getOrCreateContentCache(FileEntryRef FileEnt,
420 ContentCache &SourceManager::createMemBufferContentCache(
430 const SrcMgr::SLocEntry &SourceManager::loadSLocEntry(unsigned Index,
432 return const_cast<SourceManager *>(this)->loadSLocEntry(Index, Invalid);
435 SrcMgr::SLocEntry &SourceManager::loadSLocEntry(unsigned Index, bool *Invalid) {
455 SourceManager::AllocateLoadedSLocEntries(unsigned NumSLocEntries,
475 llvm::MemoryBufferRef SourceManager::getFakeBufferForRecovery() const {
485 SrcMgr::ContentCache &SourceManager::getFakeContentCacheForRecovery() const {
495 FileID SourceManager::getPreviousFileID(FileID FID) const {
515 FileID SourceManager::getNextFileID(FileID FID) const {
536 FileID SourceManager::createFileID(FileEntryRef SourceFile,
557 FileID SourceManager::createFileID(std::unique_ptr<llvm::MemoryBuffer> Buffer,
570 /// outlive the SourceManager.
571 FileID SourceManager::createFileID(const llvm::MemoryBufferRef &Buffer,
583 SourceManager::getOrCreateFileID(FileEntryRef SourceFile,
604 FileID SourceManager::createFileIDImpl(ContentCache &File, StringRef Filename,
654 SourceLocation SourceManager::createMacroArgExpansionLoc(
661 SourceLocation SourceManager::createExpansionLoc(
671 SourceLocation SourceManager::createTokenSplitLoc(SourceLocation Spelling,
682 SourceManager::createExpansionLocImpl(const ExpansionInfo &Info,
712 SourceManager::getMemoryBufferForFileOrNone(FileEntryRef File) {
717 void SourceManager::overrideFileContents(
727 void SourceManager::overrideFileContents(const FileEntry *SourceFile,
743 SourceManager::bypassFileContentsOverride(FileEntryRef File) {
755 void SourceManager::setFileIsTransient(FileEntryRef File) {
760 SourceManager::getNonBuiltinFilenameForID(FileID FID) const {
767 StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const {
775 SourceManager::getBufferDataIfLoaded(FileID FID) const {
781 std::optional<StringRef> SourceManager::getBufferDataOrNone(FileID FID) const {
798 FileID SourceManager::getFileIDSlow(SourceLocation::UIntTy SLocOffset) const {
813 FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const {
893 FileID SourceManager::getFileIDLoaded(SourceLocation::UIntTy SLocOffset) const {
902 SourceLocation SourceManager::
917 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const {
926 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const {
938 SourceManager::getDecomposedExpansionLocSlowCase(
956 SourceManager::getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
977 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{
985 StringRef SourceManager::getFilename(SourceLocation SpellingLoc) const {
994 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const {
1000 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const {
1008 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const {
1026 bool SourceManager::isMacroArgExpansion(SourceLocation Loc,
1039 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const {
1047 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc,
1082 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
1124 const char *SourceManager::getCharacterData(SourceLocation SL,
1150 unsigned SourceManager::getColumnNumber(FileID FID, unsigned FilePos,
1204 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc,
1211 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc,
1218 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc,
1315 unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos,
1412 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc,
1418 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc,
1424 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc,
1440 SourceManager::getFileCharacteristic(SourceLocation Loc) const {
1469 StringRef SourceManager::getBufferName(SourceLocation Loc,
1486 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc,
1531 // SourceManager
1562 bool SourceManager::isInMainFile(SourceLocation Loc) const {
1585 unsigned SourceManager::getFileIDSize(FileID FID) const {
1611 SourceLocation SourceManager::translateFileLineCol(const FileEntry *SourceFile,
1625 FileID SourceManager::translateFile(const FileEntry *SourceFile) const {
1664 SourceLocation SourceManager::translateLineCol(FileID FID,
1727 void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache,
1793 void SourceManager::associateFileChunkWithMacroArgExp(
1872 void SourceManager::updateSlocUsageStats() const {
1888 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
1922 SourceManager::getDecomposedIncludedLoc(FileID FID) const {
1950 FileID SourceManager::getUniqueLoadedASTFileID(SourceLocation Loc) const {
1968 bool SourceManager::isInTheSameTranslationUnitImpl(
1997 const SourceManager &SM) {
2009 InBeforeInTUCacheEntry &SourceManager::getInBeforeInTUCache(FileID LFID,
2038 bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
2060 std::pair<bool, bool> SourceManager::isInTheSameTranslationUnit(
2173 void SourceManager::PrintStats() const {
2203 LLVM_DUMP_METHOD void SourceManager::dump() const {
2259 void SourceManager::noteSLocAddressSpaceUsage(
2352 SourceManager::MemoryBufferSizes SourceManager::getMemoryBufferSizes() const {
2370 size_t SourceManager::getDataStructureSizes() const {
2402 SourceMgr = std::make_unique<SourceManager>(*Diagnostics, *FileMgr);