mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -792,8 +792,8 @@ ASTUnitRef ASTProducer::createASTUnit(SwiftASTManager::Implementation &MgrImpl,
|
||||
for (auto &Content : Contents)
|
||||
Stamps.push_back(Content.Stamp);
|
||||
|
||||
trace::TracedOperation TracedOp(trace::OperationKind::PerformSema);
|
||||
trace::SwiftInvocation TraceInfo;
|
||||
|
||||
if (trace::enabled()) {
|
||||
TraceInfo.Args.PrimaryFile = InvokRef->Impl.Opts.PrimaryFile;
|
||||
TraceInfo.Args.Args = InvokRef->Impl.Opts.Args;
|
||||
@@ -828,9 +828,8 @@ ASTUnitRef ASTProducer::createASTUnit(SwiftASTManager::Implementation &MgrImpl,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
trace::TracedOperation TracedOp;
|
||||
if (trace::enabled()) {
|
||||
TracedOp.start(trace::OperationKind::PerformSema, TraceInfo);
|
||||
TracedOp.start(TraceInfo);
|
||||
}
|
||||
|
||||
CloseClangModuleFiles scopedCloseFiles(
|
||||
|
||||
Reference in New Issue
Block a user