[clang] [clang][utils] Add auto mode to reduction script (PR #163282)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 15 20:03:47 PDT 2025
================
@@ -70,6 +80,44 @@ def write_to_script(text, filename):
os.chmod(filename, os.stat(filename).st_mode | stat.S_IEXEC)
+def extract_opt_level(args_list: List[str]) -> Optional[str]:
+ """
+ Finds the last optimization flag (-O...) from a list of arguments.
+
+ Args:
+ args_list: A list of string arguments passed to the compiler.
+
+ Returns:
+ The last matching optimization flag string if found, otherwise None.
+ """
+ valid_opt_flags = {"-O0", "-O1", "-O2", "-O3", "-Os", "-Oz", "-Og", "-Ofast"}
----------------
ilovepi wrote:
crap, so much for simple.
https://github.com/llvm/llvm-project/pull/163282
More information about the cfe-commits
mailing list