Rollup merge of #142784 - Kobzol:timings-codegen, r=nnethercote

Add codegen timing section

And since we now start and end the sections also using separate functions, also add some light checking if we're generating the sections correctly.

I'm integrating `--timings` into Cargo, and I realized that the codegen timings would be quite useful for that. Frontend can be computed simply as `[start of compilation, start of codegen]` for now.

r? `@nnethercote`
This commit is contained in:
Jubilee
2025-06-23 12:48:20 -07:00
committed by GitHub
4 changed files with 50 additions and 4 deletions

View File

@@ -129,6 +129,7 @@ impl Emitter for JsonEmitter {
};
let name = match record.section {
TimingSection::Linking => "link",
TimingSection::Codegen => "codegen",
};
let data = SectionTimestamp { name, event, timestamp: record.timestamp };
let result = self.emit(EmitTyped::SectionTiming(data));