[clang-tools-extra] 0cb3869 - [clangd] Fix a tsan failure.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 02:48:06 PST 2020


Author: Haojian Wu
Date: 2020-11-25T11:47:44+01:00
New Revision: 0cb38699a09d859dd40da0e4216b6066c63035f6

URL: https://github.com/llvm/llvm-project/commit/0cb38699a09d859dd40da0e4216b6066c63035f6
DIFF: https://github.com/llvm/llvm-project/commit/0cb38699a09d859dd40da0e4216b6066c63035f6.diff

LOG: [clangd] Fix a tsan failure.

Tracer must be set up before calling any clangd-specific functions.

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/RenameTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp
index d109b5139b2e..c67339ff2be4 100644
--- a/clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -1016,6 +1016,7 @@ TEST(RenameTest, PrepareRename) {
   auto ServerOpts = ClangdServer::optsForTest();
   ServerOpts.BuildDynamicSymbolIndex = true;
 
+  trace::TestTracer Tracer;
   MockCompilationDatabase CDB;
   ClangdServer Server(CDB, FS, ServerOpts);
   runAddDocument(Server, FooHPath, FooH.code());
@@ -1031,7 +1032,6 @@ TEST(RenameTest, PrepareRename) {
   EXPECT_THAT(FooCC.ranges(),
               testing::UnorderedElementsAreArray(Results->LocalChanges));
 
-  trace::TestTracer Tracer;
   // Name validation.
   Results =
       runPrepareRename(Server, FooCCPath, FooCC.point(),


        


More information about the cfe-commits mailing list