This revision was automatically updated to reflect the committed changes. Closed by commit rL362496: [clangd] Also apply adjustArguments when returning fallback commands (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D62856?vs=202924&id=202925#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62856/new/ https://reviews.llvm.org/D62856 Files: clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp Index: clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp =================================================================== --- clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp +++ clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp @@ -21,6 +21,7 @@ using ::testing::ElementsAre; using ::testing::EndsWith; using ::testing::Not; +using ::testing::StartsWith; TEST(GlobalCompilationDatabaseTest, FallbackCommand) { DirectoryBasedGlobalCompilationDatabase DB(None); @@ -85,7 +86,8 @@ TEST_F(OverlayCDBTest, GetFallbackCommand) { OverlayCDB CDB(Base.get(), {"-DA=4"}); EXPECT_THAT(CDB.getFallbackCommand(testPath("bar.cc")).CommandLine, - ElementsAre("clang", "-DA=2", testPath("bar.cc"), "-DA=4")); + ElementsAre("clang", "-DA=2", testPath("bar.cc"), "-DA=4", + "-fsyntax-only", StartsWith("-resource-dir"))); } TEST_F(OverlayCDBTest, NoBase) { @@ -97,7 +99,8 @@ Contains("-DA=5")); EXPECT_THAT(CDB.getFallbackCommand(testPath("foo.cc")).CommandLine, - ElementsAre(EndsWith("clang"), testPath("foo.cc"), "-DA=6")); + ElementsAre(EndsWith("clang"), testPath("foo.cc"), "-DA=6", + "-fsyntax-only")); } TEST_F(OverlayCDBTest, Watch) { Index: clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp =================================================================== --- clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp +++ clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp @@ -173,6 +173,7 @@ std::lock_guard<std::mutex> Lock(Mutex); Cmd.CommandLine.insert(Cmd.CommandLine.end(), FallbackFlags.begin(), FallbackFlags.end()); + adjustArguments(Cmd, ResourceDir); return Cmd; }
Index: clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp =================================================================== --- clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp +++ clang-tools-extra/trunk/clangd/unittests/GlobalCompilationDatabaseTests.cpp @@ -21,6 +21,7 @@ using ::testing::ElementsAre; using ::testing::EndsWith; using ::testing::Not; +using ::testing::StartsWith; TEST(GlobalCompilationDatabaseTest, FallbackCommand) { DirectoryBasedGlobalCompilationDatabase DB(None); @@ -85,7 +86,8 @@ TEST_F(OverlayCDBTest, GetFallbackCommand) { OverlayCDB CDB(Base.get(), {"-DA=4"}); EXPECT_THAT(CDB.getFallbackCommand(testPath("bar.cc")).CommandLine, - ElementsAre("clang", "-DA=2", testPath("bar.cc"), "-DA=4")); + ElementsAre("clang", "-DA=2", testPath("bar.cc"), "-DA=4", + "-fsyntax-only", StartsWith("-resource-dir"))); } TEST_F(OverlayCDBTest, NoBase) { @@ -97,7 +99,8 @@ Contains("-DA=5")); EXPECT_THAT(CDB.getFallbackCommand(testPath("foo.cc")).CommandLine, - ElementsAre(EndsWith("clang"), testPath("foo.cc"), "-DA=6")); + ElementsAre(EndsWith("clang"), testPath("foo.cc"), "-DA=6", + "-fsyntax-only")); } TEST_F(OverlayCDBTest, Watch) { Index: clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp =================================================================== --- clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp +++ clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp @@ -173,6 +173,7 @@ std::lock_guard<std::mutex> Lock(Mutex); Cmd.CommandLine.insert(Cmd.CommandLine.end(), FallbackFlags.begin(), FallbackFlags.end()); + adjustArguments(Cmd, ResourceDir); return Cmd; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits