File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 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 {
16551655 let output_types = parse_output_types ( & debugging_opts, matches, error_format) ;
16561656
16571657 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 (
16591659 & output_types,
16601660 matches,
16611661 error_format,
@@ -1672,6 +1672,16 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
16721672 "can't instrument with gcov profiling when compiling incrementally" ,
16731673 ) ;
16741674 }
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+ }
16751685
16761686 if cg. profile_generate . enabled ( ) && cg. profile_use . is_some ( ) {
16771687 early_error (
You can’t perform that action at this time.
0 commit comments