Skip to content

Commit 37d52fb

Browse files
authored
Merge pull request #35888 from lorentey/split-cmdline-improvements
[utils] split-cmdline: Handle typical compiler invocations better
2 parents 726a8d5 + c195b2e commit 37d52fb

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

utils/dev-scripts/split-cmdline

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -78,50 +78,47 @@ def main():
7878

7979
# A hard-coded list of options which expect a parameter
8080
is_arg_param = arg in [
81-
"-o",
82-
"-target",
83-
"-isysroot",
84-
"-emit-sil",
85-
"-emit-ir",
86-
"-module-name",
87-
"-framework",
88-
"-Xlinker",
89-
"-arch",
81+
"--sdk",
82+
"--toolchain",
9083
"-D",
91-
"-sdk",
92-
"-module-cache-path",
9384
"-F",
94-
"-output-file-map",
95-
"-emit-module-path",
96-
"-Xcc",
9785
"-I",
98-
"-iquote",
99-
"-emit-objc-header-path",
100-
"-Xfrontend",
101-
"-filelist",
102-
"-num-threads",
103-
"-Xclang",
104-
"-x",
10586
"-L",
106-
"-rpath",
107-
"-macosx_version_min",
108-
"-syslibroot",
87+
"-Xcc",
88+
"-Xclang",
89+
"-Xfrontend",
90+
"-Xlinker",
91+
"-Xllvm",
10992
"-add_ast_path",
93+
"-arch",
94+
"-emit-ir",
95+
"-emit-sil",
96+
"-filelist",
97+
"-fileno",
98+
"-framework",
11099
"-import-objc-header",
111-
"-serialize-diagnostics-path",
112-
"-emit-dependencies-path",
113-
"-emit-reference-dependencies-path",
100+
"-iquote",
101+
"-isysroot",
102+
"-macosx_version_min",
103+
"-module-link-name",
104+
"-module-name",
105+
"-num-threads",
106+
"-o",
107+
"-output-file-map",
114108
"-primary-file",
115109
"-resource-dir",
116-
"--sdk",
117-
"--toolchain",
118-
"-emit-module-doc-path",
119-
"-module-link-name",
120-
"-group-info-path",
121-
"-fileno",
110+
"-rpath",
111+
"-sdk",
122112
"-swift-version",
123-
"-Xllvm",
113+
"-syslibroot",
114+
"-target",
115+
"-target-sdk-version",
116+
"-working-directory",
117+
"-x",
124118
]
119+
# Heuristic: options ending in -path expect an argument
120+
if arg.startswith("-") and arg.endswith("-path"):
121+
is_arg_param = True
125122

126123
# Print 2 new lines after each command line
127124
print("\n")

0 commit comments

Comments
 (0)