[llvm] 8178a55 - [VFS] Fix Wreturn-type gcc warning (NFC)

Yang Fan via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 18:24:00 PST 2021


Author: Yang Fan
Date: 2021-02-03T10:22:30+08:00
New Revision: 8178a55b25704e150edf4c595a4283bc757c8fb8

URL: https://github.com/llvm/llvm-project/commit/8178a55b25704e150edf4c595a4283bc757c8fb8
DIFF: https://github.com/llvm/llvm-project/commit/8178a55b25704e150edf4c595a4283bc757c8fb8.diff

LOG: [VFS] Fix Wreturn-type gcc warning (NFC)

GCC warning:
```
In file included from /llvm-project/llvm/lib/Support/VirtualFileSystem.cpp:13:
/llvm-project/llvm/include/llvm/Support/VirtualFileSystem.h: In static member function ‘static bool llvm::vfs::RedirectingFileSystem::RemapEntry::classof(const llvm::vfs::RedirectingFileSystem::Entry*)’:
/llvm-project/llvm/include/llvm/Support/VirtualFileSystem.h:681:5: warning: control reaches end of non-void function [-Wreturn-type]
  681 |     }
      |     ^
```

Added: 
    

Modified: 
    llvm/include/llvm/Support/VirtualFileSystem.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index b718dbaf3189..d7abd1ff8552 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -678,6 +678,7 @@ class RedirectingFileSystem : public vfs::FileSystem {
       case EK_Directory:
         return false;
       }
+      llvm_unreachable("invalid entry kind");
     }
   };
 


        


More information about the llvm-commits mailing list