[clang] 347e1f6 - Frontend: Use a getVirtualFileRef for a named pipe main file, NFC

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 16:17:27 PST 2020


Author: Duncan P. N. Exon Smith
Date: 2020-12-09T16:17:14-08:00
New Revision: 347e1f621355d9b58901f3579fde91783c24ca29

URL: https://github.com/llvm/llvm-project/commit/347e1f621355d9b58901f3579fde91783c24ca29
DIFF: https://github.com/llvm/llvm-project/commit/347e1f621355d9b58901f3579fde91783c24ca29.diff

LOG: Frontend: Use a getVirtualFileRef for a named pipe main file, NFC

Added: 
    

Modified: 
    clang/lib/Frontend/CompilerInstance.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 92e5208b193b..17875a2ed85b 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -868,8 +868,8 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
           FileMgr.getBufferForFile(&File.getFileEntry(), /*isVolatile=*/true);
       if (MB) {
         // Create a new virtual file that will have the correct size.
-        const FileEntry *FE =
-            FileMgr.getVirtualFile(InputFile, (*MB)->getBufferSize(), 0);
+        FileEntryRef FE =
+            FileMgr.getVirtualFileRef(InputFile, (*MB)->getBufferSize(), 0);
         SourceMgr.overrideFileContents(FE, std::move(*MB));
         SourceMgr.setMainFileID(
             SourceMgr.createFileID(FE, SourceLocation(), Kind));


        


More information about the cfe-commits mailing list