Skip to content

Commit fb8c815

Browse files
authored
[SourceKit] Enable PrettyStackTrace printing (#17205)
In particular, this will result in PrettyStackTrace messages being included in crash logs when SourceKit crashes on Apple platforms.
1 parent 03eaa25 commit fb8c815

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "llvm/ADT/STLExtras.h"
3737
#include "llvm/Support/MemoryBuffer.h"
3838
#include "llvm/Support/Path.h"
39+
#include "llvm/Support/PrettyStackTrace.h"
3940
#include "llvm/Support/raw_ostream.h"
4041
#include <mutex>
4142

@@ -91,6 +92,7 @@ static void onDocumentUpdateNotification(StringRef DocumentName) {
9192
static SourceKit::Context *GlobalCtx = nullptr;
9293

9394
void sourcekitd::initialize() {
95+
llvm::EnablePrettyStackTrace();
9496
GlobalCtx = new SourceKit::Context(sourcekitd::getRuntimeLibPath(),
9597
SourceKit::createSwiftLangSupport);
9698
GlobalCtx->getNotificationCenter().addDocumentUpdateNotificationReceiver(

0 commit comments

Comments
 (0)