@@ -24,8 +24,6 @@ pub(crate) mod ffi;
24
24
pub ( crate ) mod map_data;
25
25
pub mod mapgen;
26
26
27
- const VAR_ALIGN : Align = Align :: EIGHT ;
28
-
29
27
/// A context object for maintaining all state needed by the coverageinfo module.
30
28
pub struct CrateCoverageContext < ' ll , ' tcx > {
31
29
/// Coverage data for each instrumented function identified by DefId.
@@ -226,7 +224,8 @@ pub(crate) fn save_cov_data_to_mod<'ll, 'tcx>(
226
224
llvm:: set_global_constant ( llglobal, true ) ;
227
225
llvm:: set_linkage ( llglobal, llvm:: Linkage :: PrivateLinkage ) ;
228
226
llvm:: set_section ( llglobal, & covmap_section_name) ;
229
- llvm:: set_alignment ( llglobal, VAR_ALIGN ) ;
227
+ // LLVM's coverage mapping format specifies 8-byte alignment for items in this section.
228
+ llvm:: set_alignment ( llglobal, Align :: EIGHT ) ;
230
229
cx. add_used_global ( llglobal) ;
231
230
}
232
231
@@ -256,7 +255,8 @@ pub(crate) fn save_func_record_to_mod<'ll, 'tcx>(
256
255
llvm:: set_linkage ( llglobal, llvm:: Linkage :: LinkOnceODRLinkage ) ;
257
256
llvm:: set_visibility ( llglobal, llvm:: Visibility :: Hidden ) ;
258
257
llvm:: set_section ( llglobal, covfun_section_name) ;
259
- llvm:: set_alignment ( llglobal, VAR_ALIGN ) ;
258
+ // LLVM's coverage mapping format specifies 8-byte alignment for items in this section.
259
+ llvm:: set_alignment ( llglobal, Align :: EIGHT ) ;
260
260
llvm:: set_comdat ( cx. llmod , llglobal, & func_record_var_name) ;
261
261
cx. add_used_global ( llglobal) ;
262
262
}
0 commit comments