]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Simplify -fsyntax-only logic
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 17 Jan 2022 17:46:45 +0000 (18:46 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 17 Jan 2022 17:46:45 +0000 (18:46 +0100)
src/argprocessing.cpp

index 1067e6659304e89fa03f0a2a4aae8f56a0d2b317..a5b3a49af29f1d0595fee876673d4eb4b2e10b0d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2021 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2022 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -1210,11 +1210,11 @@ process_args(Context& ctx)
     return Statistic::could_not_use_precompiled_header;
   }
 
-  if (!state.found_c_opt && !state.found_dc_opt && !state.found_S_opt) {
+  // -fsyntax-only/-Zs does not need -c
+  if (!state.found_c_opt && !state.found_dc_opt && !state.found_S_opt
+      && !state.found_syntax_only) {
     if (args_info.output_is_precompiled_header) {
       state.common_args.push_back("-c");
-    } else if (state.found_syntax_only) {
-      // -fsyntax-only/-Zs does not need -c
     } else {
       LOG_RAW("No -c option found");
       // Having a separate statistic for autoconf tests is useful, as they are