@@ -1094,7 +1094,6 @@ static tl::expected<Hash::Digest, Failure>
10941094to_cache (Context& ctx,
10951095 Args& args,
10961096 std::optional<Hash::Digest> result_key,
1097- const Args& depend_extra_args,
10981097 Hash* depend_mode_hash)
10991098{
11001099 if (ctx.config .is_compiler_group_msvc ()) {
@@ -1143,21 +1142,8 @@ to_cache(Context& ctx,
11431142 LOG_RAW (" Running real compiler" );
11441143
11451144 tl::expected<DoExecuteResult, Failure> result;
1146- if (!ctx.config .depend_mode ()) {
1147- result = do_execute (ctx, args);
1148- args.pop_back (3 );
1149- } else {
1150- // Use the original arguments (including dependency options) in depend
1151- // mode.
1152- Args depend_mode_args = ctx.orig_args ;
1153- depend_mode_args.erase_with_prefix (" --ccache-" );
1154- // Add depend_mode_args directly after the compiler. We can't add them last
1155- // since options then may be placed after a "--" option.
1156- depend_mode_args.insert (1 , depend_extra_args);
1157- add_prefix (depend_mode_args, ctx.config .prefix_command ());
1158-
1159- result = do_execute (ctx, depend_mode_args);
1160- }
1145+ result = do_execute (ctx, args);
1146+ args.pop_back (3 );
11611147
11621148 if (!result) {
11631149 return tl::unexpected (result.error ());
@@ -2721,11 +2707,8 @@ do_cache_compilation(Context& ctx)
27212707 Hash* depend_mode_hash = ctx.config .depend_mode () ? &direct_hash : nullptr ;
27222708
27232709 // Run real compiler, sending output to cache.
2724- const auto digest = to_cache (ctx,
2725- processed.compiler_args ,
2726- result_key,
2727- ctx.args_info .depend_extra_args ,
2728- depend_mode_hash);
2710+ const auto digest =
2711+ to_cache (ctx, processed.compiler_args , result_key, depend_mode_hash);
27292712 if (!digest) {
27302713 return tl::unexpected (digest.error ());
27312714 }
0 commit comments