[PATCH] D18399: Added support for different VFSs in format::getStyle.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 09:04:10 PDT 2016


klimek added inline comments.

================
Comment at: lib/Format/Format.cpp:2103
@@ +2102,3 @@
+  if (!FS) {
+    // If FS is not specified, the default file system is the real file system.
+    FS = vfs::getRealFileSystem().get();
----------------
I think this comment is redundant. I'd remove it.

================
Comment at: lib/Format/Format.cpp:2149
@@ -2140,3 +2148,3 @@
     // the file or not.
-    llvm::sys::fs::is_regular_file(Twine(ConfigFile), IsFile);
-
+    auto FileStatus = FS->status(ConfigFile.c_str());
+    bool IsFile = FileStatus && (FileStatus->getType() ==
----------------
Any reason to not just reassign Status (here and below)?

================
Comment at: lib/Format/Format.cpp:2157
@@ -2147,2 +2156,3 @@
       DEBUG(llvm::dbgs() << "Trying " << ConfigFile << "...\n");
-      llvm::sys::fs::is_regular_file(Twine(ConfigFile), IsFile);
+      auto Status = FS->status(Twine(ConfigFile));
+      IsFile = Status &&
----------------
I'm aware you didn't change this, but is Twine() really necessary?


http://reviews.llvm.org/D18399





More information about the cfe-commits mailing list