<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 15, 2017 at 8:43 PM, Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This doesn't seem like a good permanent solution (as Paul pointed out -std will change in the future).</div></blockquote><div>Right, clearly not :-) It's a temporary fix to get the tests to pass.</div><div>Reverting the patch isn't that useful because it only masks the problem (our testcases already include hacks around this)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Will you be able to avoid this in the future?</div></blockquote><div>Ideally we would make most of the tests independent of the default --std, probably by pinning it to something specific.</div><div>Then we'd just need one explicit test that we have the right default behavior, which would be updated when the default changes.</div><div><br></div><div>I can do some work on this, but I could use some advice from people more familiar with lit testing patterns. (Mostly this all seems like an argument for unit-testing instead, to me :-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">On 15 November 2017 at 11:38, Sam McCall via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: sammccall<br>
Date: Wed Nov 15 11:38:09 2017<br>
New Revision: 318327<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=318327&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=318327&view=rev</a><br>
Log:<br>
[clangd] Try to unbreak tests on PS4 by targeting PC explicitly<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/clangd<wbr>/GlobalCompilationDatabase.cpp<br>
<br>
Modified: clang-tools-extra/trunk/clangd<wbr>/GlobalCompilationDatabase.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp?rev=318327&r1=318326&r2=318327&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/clang-tools-extra/trunk/<wbr>clangd/GlobalCompilationDataba<wbr>se.cpp?rev=318327&r1=318326&<wbr>r2=318327&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clangd<wbr>/GlobalCompilationDatabase.cpp (original)<br>
+++ clang-tools-extra/trunk/clangd<wbr>/GlobalCompilationDatabase.cpp Wed Nov 15 11:38:09 2017<br>
@@ -31,7 +31,11 @@ static void addExtraFlags(tooling::Compi<br>
 }<br>
<br>
 tooling::CompileCommand getDefaultCompileCommand(PathR<wbr>ef File) {<br>
-  std::vector<std::string> CommandLine{"clang", "-fsyntax-only", File.str()};<br>
+  // We don't specify --std because we want to infer it from the filename.<br>
+  // We force PC because PS4 will change --std from under us.<br>
+  // FIXME: there must be a more principled way to do this!<br>
+  std::vector<std::string> CommandLine{<br>
+      "clang", "-fsyntax-only", "-triple=unknown-pc-unknown", File.str()};<br>
   return tooling::CompileCommand(llvm::<wbr>sys::path::parent_path(File),<br>
                                  llvm::sys::path::filename(File<wbr>), CommandLine,<br>
                                  /*Output=*/"");<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div></div>