mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[sourcekit] Tweak traced operation to be single-operator per RAII object
This is how it was used in all but one place anyway, and makes it easier to understand. It also aligns better with some further refactoring I want to do...
This commit is contained in:
@@ -707,13 +707,13 @@ void SwiftLangSupport::editorOpenInterface(EditorConsumer &Consumer,
|
||||
return;
|
||||
}
|
||||
|
||||
trace::TracedOperation TracedOp;
|
||||
trace::TracedOperation TracedOp(trace::OperationKind::OpenInterface);
|
||||
if (trace::enabled()) {
|
||||
trace::SwiftInvocation SwiftArgs;
|
||||
SwiftArgs.Args.Args.assign(Args.begin(), Args.end());
|
||||
// NOTE: do not use primary file
|
||||
// NOTE: do not use files
|
||||
TracedOp.start(trace::OperationKind::OpenInterface, SwiftArgs,
|
||||
TracedOp.start(SwiftArgs,
|
||||
{std::make_pair("Name", Name),
|
||||
std::make_pair("ModuleName", ModuleName)});
|
||||
}
|
||||
@@ -783,13 +783,13 @@ void SwiftLangSupport::editorOpenSwiftSourceInterface(StringRef Name,
|
||||
Consumer->handleRequestError(Error.c_str());
|
||||
return;
|
||||
}
|
||||
trace::TracedOperation TracedOp;
|
||||
trace::TracedOperation TracedOp(trace::OperationKind::OpenInterface);
|
||||
if (trace::enabled()) {
|
||||
trace::SwiftInvocation SwiftArgs;
|
||||
SwiftArgs.Args.Args.assign(Args.begin(), Args.end());
|
||||
// NOTE: do not use primary file
|
||||
// NOTE: do not use files
|
||||
TracedOp.start(trace::OperationKind::OpenInterface, SwiftArgs,
|
||||
TracedOp.start(SwiftArgs,
|
||||
{std::make_pair("Name", Name),
|
||||
std::make_pair("SourceName", SourceName)});
|
||||
}
|
||||
@@ -826,13 +826,13 @@ void SwiftLangSupport::editorOpenHeaderInterface(EditorConsumer &Consumer,
|
||||
return;
|
||||
}
|
||||
|
||||
trace::TracedOperation TracedOp;
|
||||
trace::TracedOperation TracedOp(trace::OperationKind::OpenHeaderInterface);
|
||||
if (trace::enabled()) {
|
||||
trace::SwiftInvocation SwiftArgs;
|
||||
SwiftArgs.Args.Args.assign(Args.begin(), Args.end());
|
||||
// NOTE: do not use primary file
|
||||
// NOTE: do not use files
|
||||
TracedOp.start(trace::OperationKind::OpenHeaderInterface, SwiftArgs,
|
||||
TracedOp.start(SwiftArgs,
|
||||
{std::make_pair("Name", Name),
|
||||
std::make_pair("HeaderName", HeaderName)});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user