@@ -135,6 +135,7 @@ namespace sema {
135
135
class SemaPPCallbacks : public PPCallbacks {
136
136
Sema *S = nullptr ;
137
137
llvm::SmallVector<SourceLocation, 8 > IncludeStack;
138
+ llvm::SmallVector<llvm::TimeTraceProfilerEntry *, 8 > ProfilerStack;
138
139
139
140
public:
140
141
void set (Sema &S) { this ->S = &S; }
@@ -153,8 +154,8 @@ class SemaPPCallbacks : public PPCallbacks {
153
154
if (IncludeLoc.isValid ()) {
154
155
if (llvm::timeTraceProfilerEnabled ()) {
155
156
OptionalFileEntryRef FE = SM.getFileEntryRefForID (SM.getFileID (Loc));
156
- llvm::timeTraceProfilerBegin ( " Source " , FE ? FE-> getName ()
157
- : StringRef (" <unknown>" ));
157
+ ProfilerStack. push_back ( llvm::timeTraceAsyncProfilerBegin (
158
+ " Source " , FE ? FE-> getName () : StringRef (" <unknown>" ) ));
158
159
}
159
160
160
161
IncludeStack.push_back (IncludeLoc);
@@ -167,7 +168,7 @@ class SemaPPCallbacks : public PPCallbacks {
167
168
case ExitFile:
168
169
if (!IncludeStack.empty ()) {
169
170
if (llvm::timeTraceProfilerEnabled ())
170
- llvm::timeTraceProfilerEnd ();
171
+ llvm::timeTraceProfilerEnd (ProfilerStack. pop_back_val () );
171
172
172
173
S->DiagnoseNonDefaultPragmaAlignPack (
173
174
Sema::PragmaAlignPackDiagnoseKind::ChangedStateAtExit,
0 commit comments