[PATCH] D24933: Enable configuration files in clang

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 20:30:31 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/Driver/Driver.cpp:630
+  for (const char *Dir : Directories) {
+    assert(Dir);
+    FilePath.clear();
----------------
  assert(Dir && "Directory path should not be null");


================
Comment at: lib/Driver/Driver.cpp:637
+  }
+  FilePath.clear();
+  return false;
----------------
Why do we do clear FilePath here?


================
Comment at: lib/Driver/Driver.cpp:657
+                          StringRef FileName) {
+  FilePath.clear();
+  if (searchDirectoriesForFile(FilePath, FileName, Dirs))
----------------
Is this necessary? I'd rather have a contract for these functions be that they always clear the FilePath if necessary, and then the caller will not need to worry about it.


================
Comment at: lib/Driver/Driver.cpp:661
+
+  // If not found, try searching the directory where executable resides.
+  FilePath.clear();
----------------
Why not just add this directory to the end of the list of directories?


https://reviews.llvm.org/D24933





More information about the cfe-commits mailing list