[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:
Ben Langmuir
2018-03-22 15:36:23 -07:00
parent d750d3cb37
commit 38963ce883
7 changed files with 46 additions and 48 deletions

View File

@@ -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(