On Thu, Sep 26, 2019 at 12:55 PM Mikael Holmén via cfe-commits <cfe-commits@lists.llvm.org> wrote: > > Hi Hans, > > I'm a bit suspicious against the part > > > This also revertes the part of r369938 which checked that > -working-directory works. > > in this revert. > > You do: > > > + SmallString<128> Buf; > > + if (!llvm::sys::fs::current_path(Buf)) > > + Buf = "."; > > + CDB << "{ \"directory\": \"" << escape(Buf) << "\""; > > But if I look at r369938 it seems like before r369938 it looked like > > - SmallString<128> Buf; > - if (llvm::sys::fs::current_path(Buf)) > - Buf = "."; > - CDB << "{ \"directory\": \"" << escape(Buf) << "\""; > > Note the difference in the condition, where you do > > if (!llvm::sys::fs::current_path(Buf)) > > but before it was > > if (llvm::sys::fs::current_path(Buf)) > > > We noticed this since > > clang -MJ test.json -O2 -nostdinc empty.c -S -o - && cat test.json > > started to behave differently after this revert. The "directory: " part > in the output suddenly became ".".
You're right, it definitely looks like I messed up the revert :-( Looking at the code again, I was probably thrown off by the current_path returning false on success. Since you've been investigating, are you set up to land a fix with a test maybe? Otherwise I can do it, please let me know. Thanks, Hans _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits