[clangd] Revert broken r318329 and disable tests on PS4
authorSam McCall <sam.mccall@gmail.com>
Wed, 15 Nov 2017 21:33:56 +0000 (21:33 +0000)
committerSam McCall <sam.mccall@gmail.com>
Wed, 15 Nov 2017 21:33:56 +0000 (21:33 +0000)
(Clearly this is not a permanent solution)

llvm-svn: 318337

clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
clang-tools-extra/test/clangd/lit.local.cfg [new file with mode: 0644]

index 4466e40..1db3e66 100644 (file)
@@ -31,11 +31,7 @@ static void addExtraFlags(tooling::CompileCommand &Command,
 }
 
 tooling::CompileCommand getDefaultCompileCommand(PathRef File) {
-  // 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", "-target=unknown-pc-unknown", File.str()};
+  std::vector<std::string> CommandLine{"clang", "-fsyntax-only", File.str()};
   return tooling::CompileCommand(llvm::sys::path::parent_path(File),
                                  llvm::sys::path::filename(File), CommandLine,
                                  /*Output=*/"");
diff --git a/clang-tools-extra/test/clangd/lit.local.cfg b/clang-tools-extra/test/clangd/lit.local.cfg
new file mode 100644 (file)
index 0000000..ef338c7
--- /dev/null
@@ -0,0 +1,6 @@
+import re
+# We rely on the default -std being derived from the filetype.
+# PS4 sets a different -std, and many tests break.
+# FIXME: make our tests less brittle instead.
+if re.match(r'.*-scei-ps4', config.target_triple):
+  config.unsupported = True