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"
58 // SourceManager Helper Classes
273 unsigned SourceManager::getLineTableFilenameID(StringRef Name) {
280 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo,
308 LineTableInfo &SourceManager::getLineTable() {
318 SourceManager::SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr,
325 SourceManager::~SourceManager() {
343 void SourceManager::clearIDTables() {
362 bool SourceManager::isMainFile(const FileEntry &SourceFile) {
363 assert(MainFileID.isValid() && "expected initialized SourceManager");
369 void SourceManager::initializeForReplay(const SourceManager &Old) {
370 assert(MainFileID.isInvalid() && "expected uninitialized SourceManager");
397 ContentCache &SourceManager::getOrCreateContentCache(FileEntryRef FileEnt,
430 ContentCache &SourceManager::createMemBufferContentCache(
440 const SrcMgr::SLocEntry &SourceManager::loadSLocEntry(unsigned Index,
442 return const_cast<SourceManager *>(this)->loadSLocEntry(Index, Invalid);
445 SrcMgr::SLocEntry &SourceManager::loadSLocEntry(unsigned Index, bool *Invalid) {
465 SourceManager::AllocateLoadedSLocEntries(unsigned NumSLocEntries,
485 llvm::MemoryBufferRef SourceManager::getFakeBufferForRecovery() const {
495 SrcMgr::ContentCache &SourceManager::getFakeContentCacheForRecovery() const {
505 FileID SourceManager::getPreviousFileID(FileID FID) const {
525 FileID SourceManager::getNextFileID(FileID FID) const {
546 FileID SourceManager::createFileID(FileEntryRef SourceFile,
567 FileID SourceManager::createFileID(std::unique_ptr<llvm::MemoryBuffer> Buffer,
580 /// outlive the SourceManager.
581 FileID SourceManager::createFileID(const llvm::MemoryBufferRef &Buffer,
593 SourceManager::getOrCreateFileID(FileEntryRef SourceFile,
603 FileID SourceManager::createFileIDImpl(ContentCache &File, StringRef Filename,
639 SourceLocation SourceManager::createMacroArgExpansionLoc(
646 SourceLocation SourceManager::createExpansionLoc(
656 SourceLocation SourceManager::createTokenSplitLoc(SourceLocation Spelling,
667 SourceManager::createExpansionLocImpl(const ExpansionInfo &Info,
697 SourceManager::getMemoryBufferForFileOrNone(FileEntryRef File) {
702 void SourceManager::overrideFileContents(
712 void SourceManager::overrideFileContents(const FileEntry *SourceFile,
728 SourceManager::bypassFileContentsOverride(FileEntryRef File) {
740 void SourceManager::setFileIsTransient(FileEntryRef File) {
745 SourceManager::getNonBuiltinFilenameForID(FileID FID) const {
752 StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const {
760 SourceManager::getBufferDataIfLoaded(FileID FID) const {
766 std::optional<StringRef> SourceManager::getBufferDataOrNone(FileID FID) const {
783 FileID SourceManager::getFileIDSlow(SourceLocation::UIntTy SLocOffset) const {
798 FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const {
878 FileID SourceManager::getFileIDLoaded(SourceLocation::UIntTy SLocOffset) const {
887 SourceLocation SourceManager::
902 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const {
911 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const {
923 SourceManager::getDecomposedExpansionLocSlowCase(
941 SourceManager::getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
962 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{
970 StringRef SourceManager::getFilename(SourceLocation SpellingLoc) const {
979 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const {
985 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const {
993 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const {
1011 bool SourceManager::isMacroArgExpansion(SourceLocation Loc,
1024 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const {
1032 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc,
1067 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
1109 const char *SourceManager::getCharacterData(SourceLocation SL,
1135 unsigned SourceManager::getColumnNumber(FileID FID, unsigned FilePos,
1189 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc,
1196 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc,
1203 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc,
1300 unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos,
1397 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc,
1403 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc,
1409 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc,
1425 SourceManager::getFileCharacteristic(SourceLocation Loc) const {
1454 StringRef SourceManager::getBufferName(SourceLocation Loc,
1471 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc,
1516 // SourceManager
1547 bool SourceManager::isInMainFile(SourceLocation Loc) const {
1570 unsigned SourceManager::getFileIDSize(FileID FID) const {
1596 SourceLocation SourceManager::translateFileLineCol(const FileEntry *SourceFile,
1610 FileID SourceManager::translateFile(const FileEntry *SourceFile) const {
1649 SourceLocation SourceManager::translateLineCol(FileID FID,
1712 void SourceManager::computeMacroArgsCache(MacroArgsMap &MacroArgsCache,
1778 void SourceManager::associateFileChunkWithMacroArgExp(
1857 void SourceManager::updateSlocUsageStats() const {
1873 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
1907 SourceManager::getDecomposedIncludedLoc(FileID FID) const {
1935 FileID SourceManager::getUniqueLoadedASTFileID(SourceLocation Loc) const {
1953 bool SourceManager::isInTheSameTranslationUnitImpl(
1982 const SourceManager &SM) {
1994 InBeforeInTUCacheEntry &SourceManager::getInBeforeInTUCache(FileID LFID,
2023 bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
2046 std::pair<bool, bool> SourceManager::isInTheSameTranslationUnit(
2159 void SourceManager::PrintStats() const {
2189 LLVM_DUMP_METHOD void SourceManager::dump() const {
2245 void SourceManager::noteSLocAddressSpaceUsage(
2337 SourceManager::MemoryBufferSizes SourceManager::getMemoryBufferSizes() const {
2355 size_t SourceManager::getDataStructureSizes() const {
2387 SourceMgr = std::make_unique<SourceManager>(*Diagnostics, *FileMgr);