Skip to content

[utils] split-cmdline: Handle typical compiler invocations better #35888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 31 additions & 34 deletions utils/dev-scripts/split-cmdline
Original file line number Diff line number Diff line change
Expand Up @@ -78,50 +78,47 @@ def main():

# A hard-coded list of options which expect a parameter
is_arg_param = arg in [
"-o",
"-target",
"-isysroot",
"-emit-sil",
"-emit-ir",
"-module-name",
"-framework",
"-Xlinker",
"-arch",
"--sdk",
"--toolchain",
"-D",
"-sdk",
"-module-cache-path",
"-F",
"-output-file-map",
"-emit-module-path",
"-Xcc",
"-I",
"-iquote",
"-emit-objc-header-path",
"-Xfrontend",
"-filelist",
"-num-threads",
"-Xclang",
"-x",
"-L",
"-rpath",
"-macosx_version_min",
"-syslibroot",
"-Xcc",
"-Xclang",
"-Xfrontend",
"-Xlinker",
"-Xllvm",
"-add_ast_path",
"-arch",
"-emit-ir",
"-emit-sil",
"-filelist",
"-fileno",
"-framework",
"-import-objc-header",
"-serialize-diagnostics-path",
"-emit-dependencies-path",
"-emit-reference-dependencies-path",
"-iquote",
"-isysroot",
"-macosx_version_min",
"-module-link-name",
"-module-name",
"-num-threads",
"-o",
"-output-file-map",
"-primary-file",
"-resource-dir",
"--sdk",
"--toolchain",
"-emit-module-doc-path",
"-module-link-name",
"-group-info-path",
"-fileno",
"-rpath",
"-sdk",
"-swift-version",
"-Xllvm",
"-syslibroot",
"-target",
"-target-sdk-version",
"-working-directory",
"-x",
]
# Heuristic: options ending in -path expect an argument
if arg.startswith("-") and arg.endswith("-path"):
is_arg_param = True

# Print 2 new lines after each command line
print("\n")
Expand Down