ilya-biryukov added inline comments.
================ Comment at: lib/Tooling/Tooling.cpp:419 - } else { - llvm::report_fatal_error("Cannot detect current path: " + - Twine(CWD.getError().message())); ---------------- ioeric wrote: > ilya-biryukov wrote: > > ioeric wrote: > > > Should we still check if `CWD` is correctly set? > > Not sure we know which CWD is correct at this point. Do you mean to check > > that `getCurrentWorkingDirectory ` does not return an error? > Yes. > > Actually, after a closer look, I noticed `getAbsolutePath` below is just > using the current working directory in real file system, which seems wrong. > This is pre-existing but would be nice to fix since we are here :) What do we do if CWD is wrong? Checking for errors in getAbsolutePath and setCurrentWorkingDirectory should be enough and that's what we already do. > Actually, after a closer look, I noticed getAbsolutePath below is just using > the current working directory in real file system, which seems wrong. This is > pre-existing but would be nice to fix since we are here :) Unfortunately, `getAbsolutePath` is a public API (with not too many usages, but still). I've added a helper function that goes through VFS and forwarding to it in the `getAbsoltuePath` for now, but we might want to look at changing the API there. Repository: rC Clang https://reviews.llvm.org/D51407 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits