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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits