This doesn't seem like a good permanent solution (as Paul pointed out -std
will change in the future). Will you be able to avoid this in the future?

On 15 November 2017 at 11:38, Sam McCall via cfe-commits <
cfe-commits@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@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to