]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add knowledge about -fprofile-{correction,reorder-functions,values}
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 21 Jul 2020 13:00:59 +0000 (15:00 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 21 Jul 2020 17:53:34 +0000 (19:53 +0200)
Fixes #615.

(cherry picked from commit c1bf116630f22952732feeffaa71b827c1e813bd)

src/argprocessing.cpp

index 10cf355faece55b7d3f82e20b6c26e83b5cb6352..d81a9d3a80d05317e203f056d7bf0bab71739ebe 100644 (file)
@@ -131,6 +131,18 @@ detect_pch(Context& ctx,
 bool
 process_profiling_option(Context& ctx, const std::string& arg)
 {
+  static const std::vector<std::string> known_simple_options = {
+    "-fprofile-correction",
+    "-fprofile-reorder-functions",
+    "-fprofile-sample-accurate",
+    "-fprofile-values",
+  };
+
+  if (std::find(known_simple_options.begin(), known_simple_options.end(), arg)
+      != known_simple_options.end()) {
+    return true;
+  }
+
   std::string new_profile_path;
   bool new_profile_use = false;
 
@@ -161,8 +173,6 @@ process_profiling_option(Context& ctx, const std::string& arg)
              || Util::starts_with(arg, "-fauto-profile=")) {
     new_profile_use = true;
     new_profile_path = arg.substr(arg.find('=') + 1);
-  } else if (arg == "-fprofile-sample-accurate") {
-    return true;
   } else {
     cc_log("Unknown profiling option: %s", arg.c_str());
     return false;