[Frontend] Remap -O to -cc commandline flag (#29557)

Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yanan Cao
2025-11-28 21:51:12 +00:00
committed by GitHub
co-authored by Claude
parent fecae12cd7
commit 3461e7efd8
9 changed files with 72 additions and 39 deletions
+11
View File
@@ -257,6 +257,17 @@ class FlexibleArgumentParser(ArgumentParser):
):
# Convert -O <n> to --optimization-level <n>
processed_args.append("--optimization-level")
elif arg.startswith("-O."):
# Handle -O.* dotted syntax - ALL dotted syntax is deprecated
logger.warning_once(
"The -O.* dotted syntax for --compilation-config is "
"deprecated and will be removed in v0.13.0 or v1.0.0"
", whichever is earlier. Please use -cc.* instead. "
"Example: -cc.backend=eager instead of "
"-O.backend=eager."
)
converted_arg = arg.replace("-O", "-cc", 1)
processed_args.append(converted_arg)
else:
processed_args.append(arg)