<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">Hi,</div>
<br>
<div dir="ltr">As Karl-Johan said I'll be out of office for a few days so please submit a fix if you can find the time.</div>
<br>
<div dir="ltr">Thanks,</div>
<div dir="ltr">Mikael</div>
<br>
<div class="quote">Den 26 sep. 2019 15:39 skrev Hans Wennborg <hans@chromium.org>:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="bx-html">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
<div class="bx-body"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Thu, Sep 26, 2019 at 12:55 PM Mikael Holmén via cfe-commits<br>
<cfe-commits@lists.llvm.org> wrote:<br>
><br>
> Hi Hans,<br>
><br>
> I'm a bit suspicious against the part<br>
><br>
> > This also revertes the part of r369938 which checked that<br>
> -working-directory works.<br>
><br>
> in this revert.<br>
><br>
> You do:<br>
><br>
> > + SmallString<128> Buf;<br>
> > + if (!llvm::sys::fs::current_path(Buf))<br>
> > + Buf = ".";<br>
> > + CDB << "{ \"directory\": \"" << escape(Buf) << "\"";<br>
><br>
> But if I look at r369938 it seems like before r369938 it looked like<br>
><br>
> - SmallString<128> Buf;<br>
> - if (llvm::sys::fs::current_path(Buf))<br>
> - Buf = ".";<br>
> - CDB << "{ \"directory\": \"" << escape(Buf) << "\"";<br>
><br>
> Note the difference in the condition, where you do<br>
><br>
> if (!llvm::sys::fs::current_path(Buf))<br>
><br>
> but before it was<br>
><br>
> if (llvm::sys::fs::current_path(Buf))<br>
><br>
><br>
> We noticed this since<br>
><br>
> clang -MJ test.json -O2 -nostdinc empty.c -S -o - && cat test.json<br>
><br>
> started to behave differently after this revert. The "directory: " part<br>
> in the output suddenly became ".".<br>
<br>
You're right, it definitely looks like I messed up the revert :-(<br>
Looking at the code again, I was probably thrown off by the<br>
current_path returning false on success.<br>
<br>
Since you've been investigating, are you set up to land a fix with a<br>
test maybe? Otherwise I can do it, please let me know.<br>
<br>
Thanks,<br>
Hans<br>
</div>
</span></font></div>
</div>
</blockquote>
</div>
</body>
</html>