File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
unittests/SourceKit/SwiftLang Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 1616#include " SourceKit/Core/NotificationCenter.h"
1717#include " SourceKit/Support/Concurrency.h"
1818#include " SourceKit/SwiftLang/Factory.h"
19+ #include " swift/Basic/LLVMInitialize.h"
1920#include " llvm/Support/MemoryBuffer.h"
2021#include " llvm/Support/Path.h"
2122#include " llvm/Support/TargetSelect.h"
@@ -63,10 +64,6 @@ class CursorInfoTest : public ::testing::Test {
6364 LangSupport &getLang () { return getContext ().getSwiftLangSupport (); }
6465
6566 void SetUp () override {
66- llvm::InitializeAllTargets ();
67- llvm::InitializeAllTargetMCs ();
68- llvm::InitializeAllAsmPrinters ();
69- llvm::InitializeAllAsmParsers ();
7067 NumTasks = 0 ;
7168 }
7269
@@ -76,6 +73,7 @@ class CursorInfoTest : public ::testing::Test {
7673 /* diagnosticDocumentationPath*/ "",
7774 SourceKit::createSwiftLangSupport,
7875 /* dispatchOnMain=*/ false)) {
76+ INITIALIZE_LLVM ();
7977 // This is avoiding destroying \p SourceKit::Context because another
8078 // thread may be active trying to use it to post notifications.
8179 // FIXME: Use shared_ptr ownership to avoid such issues.
Original file line number Diff line number Diff line change 1515#include " SourceKit/Core/NotificationCenter.h"
1616#include " SourceKit/Support/Concurrency.h"
1717#include " SourceKit/SwiftLang/Factory.h"
18+ #include " swift/Basic/LLVMInitialize.h"
1819#include " llvm/Support/MemoryBuffer.h"
1920#include " llvm/Support/Path.h"
2021#include " llvm/Support/TargetSelect.h"
@@ -121,6 +122,7 @@ class EditTest : public ::testing::Test {
121122
122123public:
123124 EditTest () {
125+ INITIALIZE_LLVM ();
124126 // This is avoiding destroying \p SourceKit::Context because another
125127 // thread may be active trying to use it to post notifications.
126128 // FIXME: Use shared_ptr ownership to avoid such issues.
@@ -141,13 +143,6 @@ class EditTest : public ::testing::Test {
141143
142144 LangSupport &getLang () { return Ctx->getSwiftLangSupport (); }
143145
144- void SetUp () override {
145- llvm::InitializeAllTargets ();
146- llvm::InitializeAllTargetMCs ();
147- llvm::InitializeAllAsmPrinters ();
148- llvm::InitializeAllAsmParsers ();
149- }
150-
151146 void addNotificationReceiver (DocumentUpdateNotificationReceiver Receiver) {
152147 Ctx->getNotificationCenter ()->addDocumentUpdateNotificationReceiver (Receiver);
153148 }
You can’t perform that action at this time.
0 commit comments