This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG0b09b5d44837: [clang][lex] NFC: Use FileEntryRef in PreprocessorLexer::getFileEntry() (authored by jansvoboda11).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123772/new/ https://reviews.llvm.org/D123772 Files: clang/include/clang/Lex/PreprocessorLexer.h clang/lib/Lex/PreprocessorLexer.cpp clang/lib/Sema/SemaCodeComplete.cpp Index: clang/lib/Sema/SemaCodeComplete.cpp =================================================================== --- clang/lib/Sema/SemaCodeComplete.cpp +++ clang/lib/Sema/SemaCodeComplete.cpp @@ -9972,7 +9972,7 @@ using llvm::make_range; if (!Angled) { // The current directory is on the include path for "quoted" includes. - auto *CurFile = PP.getCurrentFileLexer()->getFileEntry(); + const FileEntry *CurFile = PP.getCurrentFileLexer()->getFileEntry(); if (CurFile && CurFile->getDir()) AddFilesFromIncludeDir(CurFile->getDir()->getName(), false, DirectoryLookup::LT_NormalDir); Index: clang/lib/Lex/PreprocessorLexer.cpp =================================================================== --- clang/lib/Lex/PreprocessorLexer.cpp +++ clang/lib/Lex/PreprocessorLexer.cpp @@ -47,6 +47,7 @@ /// getFileEntry - Return the FileEntry corresponding to this FileID. Like /// getFileID(), this only works for lexers with attached preprocessors. -const FileEntry *PreprocessorLexer::getFileEntry() const { - return PP->getSourceManager().getFileEntryForID(getFileID()); +OptionalFileEntryRefDegradesToFileEntryPtr +PreprocessorLexer::getFileEntry() const { + return PP->getSourceManager().getFileEntryRefForID(getFileID()); } Index: clang/include/clang/Lex/PreprocessorLexer.h =================================================================== --- clang/include/clang/Lex/PreprocessorLexer.h +++ clang/include/clang/Lex/PreprocessorLexer.h @@ -165,7 +165,7 @@ /// getFileEntry - Return the FileEntry corresponding to this FileID. Like /// getFileID(), this only works for lexers with attached preprocessors. - const FileEntry *getFileEntry() const; + OptionalFileEntryRefDegradesToFileEntryPtr getFileEntry() const; /// Iterator that traverses the current stack of preprocessor /// conditional directives (\#if/\#ifdef/\#ifndef).
Index: clang/lib/Sema/SemaCodeComplete.cpp =================================================================== --- clang/lib/Sema/SemaCodeComplete.cpp +++ clang/lib/Sema/SemaCodeComplete.cpp @@ -9972,7 +9972,7 @@ using llvm::make_range; if (!Angled) { // The current directory is on the include path for "quoted" includes. - auto *CurFile = PP.getCurrentFileLexer()->getFileEntry(); + const FileEntry *CurFile = PP.getCurrentFileLexer()->getFileEntry(); if (CurFile && CurFile->getDir()) AddFilesFromIncludeDir(CurFile->getDir()->getName(), false, DirectoryLookup::LT_NormalDir); Index: clang/lib/Lex/PreprocessorLexer.cpp =================================================================== --- clang/lib/Lex/PreprocessorLexer.cpp +++ clang/lib/Lex/PreprocessorLexer.cpp @@ -47,6 +47,7 @@ /// getFileEntry - Return the FileEntry corresponding to this FileID. Like /// getFileID(), this only works for lexers with attached preprocessors. -const FileEntry *PreprocessorLexer::getFileEntry() const { - return PP->getSourceManager().getFileEntryForID(getFileID()); +OptionalFileEntryRefDegradesToFileEntryPtr +PreprocessorLexer::getFileEntry() const { + return PP->getSourceManager().getFileEntryRefForID(getFileID()); } Index: clang/include/clang/Lex/PreprocessorLexer.h =================================================================== --- clang/include/clang/Lex/PreprocessorLexer.h +++ clang/include/clang/Lex/PreprocessorLexer.h @@ -165,7 +165,7 @@ /// getFileEntry - Return the FileEntry corresponding to this FileID. Like /// getFileID(), this only works for lexers with attached preprocessors. - const FileEntry *getFileEntry() const; + OptionalFileEntryRefDegradesToFileEntryPtr getFileEntry() const; /// Iterator that traverses the current stack of preprocessor /// conditional directives (\#if/\#ifdef/\#ifndef).
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits