[clang-tools-extra] r318327 - [clangd] Try to unbreak tests on PS4 by targeting PC explicitly

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 11:55:51 PST 2017


On Wed, Nov 15, 2017 at 8:43 PM, Alex L <arphaman at gmail.com> wrote:

> This doesn't seem like a good permanent solution (as Paul pointed out -std
> will change in the future).
>
Right, clearly not :-) It's a temporary fix to get the tests to pass.
Reverting the patch isn't that useful because it only masks the problem
(our testcases already include hacks around this)

Will you be able to avoid this in the future?
>
Ideally we would make most of the tests independent of the default --std,
probably by pinning it to something specific.
Then we'd just need one explicit test that we have the right default
behavior, which would be updated when the default changes.

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 :-)

On 15 November 2017 at 11:38, Sam McCall via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> Author: sammccall
>> Date: Wed Nov 15 11:38:09 2017
>> New Revision: 318327
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=318327&view=rev
>> Log:
>> [clangd] Try to unbreak tests on PS4 by targeting PC explicitly
>>
>> Modified:
>>     clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp
>>
>> Modified: clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp
>> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/
>> clangd/GlobalCompilationDatabase.cpp?rev=318327&r1=318326&
>> r2=318327&view=diff
>> ============================================================
>> ==================
>> --- clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp
>> (original)
>> +++ clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp Wed Nov
>> 15 11:38:09 2017
>> @@ -31,7 +31,11 @@ static void addExtraFlags(tooling::Compi
>>  }
>>
>>  tooling::CompileCommand getDefaultCompileCommand(PathRef File) {
>> -  std::vector<std::string> CommandLine{"clang", "-fsyntax-only",
>> File.str()};
>> +  // We don't specify --std because we want to infer it from the
>> filename.
>> +  // We force PC because PS4 will change --std from under us.
>> +  // FIXME: there must be a more principled way to do this!
>> +  std::vector<std::string> CommandLine{
>> +      "clang", "-fsyntax-only", "-triple=unknown-pc-unknown",
>> File.str()};
>>    return tooling::CompileCommand(llvm::sys::path::parent_path(File),
>>                                   llvm::sys::path::filename(File),
>> CommandLine,
>>                                   /*Output=*/"");
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171115/0d159845/attachment.html>


More information about the cfe-commits mailing list