@@ -77,6 +77,13 @@ struct LLVMRustCoverageCodeRegion {
77
77
LLVMRustCounter Count;
78
78
};
79
79
80
+ // Must match the layout of
81
+ // `rustc_codegen_llvm::coverageinfo::ffi::ExpansionRegion`.
82
+ struct LLVMRustCoverageExpansionRegion {
83
+ LLVMRustCoverageSpan Span;
84
+ uint32_t ExpandedFileID;
85
+ };
86
+
80
87
// Must match the layout of
81
88
// `rustc_codegen_llvm::coverageinfo::ffi::BranchRegion`.
82
89
struct LLVMRustCoverageBranchRegion {
@@ -151,6 +158,8 @@ extern "C" void LLVMRustCoverageWriteFunctionMappingsToBuffer(
151
158
const unsigned *VirtualFileMappingIDs, size_t NumVirtualFileMappingIDs,
152
159
const LLVMRustCounterExpression *RustExpressions, size_t NumExpressions,
153
160
const LLVMRustCoverageCodeRegion *CodeRegions, size_t NumCodeRegions,
161
+ const LLVMRustCoverageExpansionRegion *ExpansionRegions,
162
+ size_t NumExpansionRegions,
154
163
const LLVMRustCoverageBranchRegion *BranchRegions, size_t NumBranchRegions,
155
164
const LLVMRustCoverageMCDCBranchRegion *MCDCBranchRegions,
156
165
size_t NumMCDCBranchRegions,
@@ -179,6 +188,13 @@ extern "C" void LLVMRustCoverageWriteFunctionMappingsToBuffer(
179
188
Region.Span .ColumnStart , Region.Span .LineEnd , Region.Span .ColumnEnd ));
180
189
}
181
190
191
+ // Expansion regions:
192
+ for (const auto &Region : ArrayRef (ExpansionRegions, NumExpansionRegions)) {
193
+ MappingRegions.push_back (coverage::CounterMappingRegion::makeExpansion (
194
+ Region.Span .FileID , Region.ExpandedFileID , Region.Span .LineStart ,
195
+ Region.Span .ColumnStart , Region.Span .LineEnd , Region.Span .ColumnEnd ));
196
+ }
197
+
182
198
// Branch regions:
183
199
for (const auto &Region : ArrayRef (BranchRegions, NumBranchRegions)) {
184
200
MappingRegions.push_back (coverage::CounterMappingRegion::makeBranchRegion (
0 commit comments