[Lldb-commits] [PATCH] D54020: [FileSystem] Open File instances through the FileSystem.

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 2 08:54:57 PDT 2018


JDevlieghere added inline comments.


================
Comment at: source/Host/common/FileSystem.cpp:253
+static int GetOpenFlags(uint32_t options) {
+  const bool read = options & File::OpenOptions::eOpenOptionRead;
+  const bool write = options & File::OpenOptions::eOpenOptionWrite;
----------------
labath wrote:
> `File::eOpenOptionRead` should be sufficient, no?
Sorry, I don't know what you mean?


================
Comment at: source/Host/posix/FileSystem.cpp:74-79
+FILE *FileSystem::Fopen(const char *path, const char *mode) const {
   return ::fopen(path, mode);
 }
 
-int FileSystem::Open(const char *path, int flags, int mode) {
+int FileSystem::Open(const char *path, int flags, int mode) const {
   return ::open(path, flags, mode);
----------------
labath wrote:
> Why are these two `const`? It seems that at least with `eOpenOptionCanCreate`, one can create a new file, which is definitely not a "const" operation.
Depends on what you consider const, the real filesystem or the class. But yeah, the `const` doesn't add much so I can un-const this. 


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D54020





More information about the lldb-commits mailing list