File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1655,7 +1655,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1655
1655
let output_types = parse_output_types ( & debugging_opts, matches, error_format) ;
1656
1656
1657
1657
let mut cg = build_codegen_options ( matches, error_format) ;
1658
- let ( disable_thinlto, codegen_units) = should_override_cgus_and_disable_thinlto (
1658
+ let ( disable_thinlto, mut codegen_units) = should_override_cgus_and_disable_thinlto (
1659
1659
& output_types,
1660
1660
matches,
1661
1661
error_format,
@@ -1672,6 +1672,16 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1672
1672
"can't instrument with gcov profiling when compiling incrementally" ,
1673
1673
) ;
1674
1674
}
1675
+ if debugging_opts. profile {
1676
+ match codegen_units {
1677
+ Some ( 1 ) => { }
1678
+ None => codegen_units = Some ( 1 ) ,
1679
+ Some ( _) => early_error (
1680
+ error_format,
1681
+ "can't instrument with gcov profiling with multiple codegen units" ,
1682
+ ) ,
1683
+ }
1684
+ }
1675
1685
1676
1686
if cg. profile_generate . enabled ( ) && cg. profile_use . is_some ( ) {
1677
1687
early_error (
You can’t perform that action at this time.
0 commit comments