|
2 | 2 |
|
3 | 3 | use rustc_index::IndexVec;
|
4 | 4 | use rustc_macros::HashStable;
|
5 |
| -use rustc_span::Symbol; |
| 5 | +use rustc_span::{Span, Symbol}; |
6 | 6 |
|
7 | 7 | use std::fmt::{self, Debug, Formatter};
|
8 | 8 |
|
@@ -84,7 +84,7 @@ pub enum CoverageKind {
|
84 | 84 | SpanMarker,
|
85 | 85 |
|
86 | 86 | /// Marks its enclosing basic block with an ID that can be referred to by
|
87 |
| - /// other data in the MIR body. |
| 87 | + /// side data in [`HirBranchInfo`]. |
88 | 88 | ///
|
89 | 89 | /// Has no effect during codegen.
|
90 | 90 | BlockMarker { id: BlockMarkerId },
|
@@ -210,9 +210,24 @@ pub struct FunctionCoverageInfo {
|
210 | 210 | pub mappings: Vec<Mapping>,
|
211 | 211 | }
|
212 | 212 |
|
| 213 | +#[derive(Clone, Debug)] |
| 214 | +#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] |
| 215 | +pub struct HirBranchInfo { |
| 216 | + pub num_block_markers: usize, |
| 217 | + pub branch_spans: Vec<BranchSpan>, |
| 218 | +} |
| 219 | + |
213 | 220 | rustc_index::newtype_index! {
|
214 | 221 | #[derive(HashStable)]
|
215 | 222 | #[encodable]
|
216 | 223 | #[debug_format = "BlockMarkerId({})"]
|
217 | 224 | pub struct BlockMarkerId {}
|
218 | 225 | }
|
| 226 | + |
| 227 | +#[derive(Clone, Debug)] |
| 228 | +#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] |
| 229 | +pub struct BranchSpan { |
| 230 | + pub span: Span, |
| 231 | + pub true_marker: BlockMarkerId, |
| 232 | + pub false_marker: BlockMarkerId, |
| 233 | +} |
0 commit comments