[sourcekit] Add optional compile notifications

When enabled, send a notification before/after every "compilation",
which for now means `performSema`. This piggy-backs and modifies some
existing code that we had for "tracing" operations in sourcekitd that
unfortunately was untested.  At least now some of the basic parts are
tested via the new notifications.

Part of rdar://38438512
This commit is contained in:
Ben Langmuir
2018-03-23 13:49:20 -07:00
parent 38963ce883
commit 79d641d89b
24 changed files with 388 additions and 123 deletions

View File

@@ -112,7 +112,7 @@ static bool swiftCodeCompleteImpl(SwiftLangSupport &Lang,
std::string &Error) {
trace::TracedOperation TracedInit(trace::OperationKind::CodeCompletionInit);
if (trace::enabled()) {
if (TracedInit.enabled()) {
trace::SwiftInvocation SwiftArgs;
trace::initTraceInfo(SwiftArgs,
UnresolvedInputFile->getBufferIdentifier(),
@@ -190,7 +190,7 @@ static bool swiftCodeCompleteImpl(SwiftLangSupport &Lang,
trace::TracedOperation TracedOp(trace::OperationKind::CodeCompletion);
if (trace::enabled()) {
if (TracedOp.enabled()) {
trace::SwiftInvocation SwiftArgs;
trace::initTraceInfo(SwiftArgs, InputFile->getBufferIdentifier(), Args);
trace::initTraceFiles(SwiftArgs, CI);