Skip to content

Commit 527281a

Browse files
committed
[gn build] re-run "gn format" with trunk gn
1 parent eadc282 commit 527281a

File tree

87 files changed

+170
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+170
-490
lines changed

llvm/utils/gn/build/symlink_or_copy.gni

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ template("symlink_or_copy") {
1010
# https://github.com/ninja-build/ninja/issues/1186
1111
stamp =
1212
"$target_gen_dir/" + get_path_info(invoker.output, "file") + ".stamp"
13-
outputs = [
14-
stamp,
15-
]
13+
outputs = [ stamp ]
1614
script = "//llvm/utils/gn/build/symlink_or_copy.py"
1715
args = [
1816
"--stamp",

llvm/utils/gn/build/toolchain/BUILD.gn

+12-36
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,23 @@ template("unix_toolchain") {
1818
command = "$cc -MMD -MF $depfile -o {{output}} -c {{source}} {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
1919
depsformat = "gcc"
2020
description = "CC {{output}}"
21-
outputs = [
22-
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
23-
]
21+
outputs = [ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o" ]
2422
}
2523

2624
tool("cxx") {
2725
depfile = "{{output}}.d"
2826
command = "$cxx -MMD -MF $depfile -o {{output}} -c {{source}} {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}"
2927
depsformat = "gcc"
3028
description = "CXX {{output}}"
31-
outputs = [
32-
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
33-
]
29+
outputs = [ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o" ]
3430
}
3531

3632
tool("asm") {
3733
depfile = "{{output}}.d"
3834
command = "$cc -MMD -MF $depfile -o {{output}} -c {{source}} {{defines}} {{include_dirs}} {{asmflags}}"
3935
depsformat = "gcc"
4036
description = "ASM {{output}}"
41-
outputs = [
42-
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
43-
]
37+
outputs = [ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o" ]
4438
}
4539

4640
tool("alink") {
@@ -53,9 +47,7 @@ template("unix_toolchain") {
5347
"rm -f {{output}} && $ar rcsD {{arflags}} {{output}} {{inputs}}"
5448
}
5549
description = "AR {{output}}"
56-
outputs = [
57-
"{{output_dir}}/{{target_output_name}}.a",
58-
]
50+
outputs = [ "{{output_dir}}/{{target_output_name}}.a" ]
5951
output_prefix = "lib"
6052
default_output_dir = "{{root_out_dir}}/lib"
6153
}
@@ -70,9 +62,7 @@ template("unix_toolchain") {
7062
default_output_extension = ".so"
7163
}
7264
description = "SOLINK $outfile"
73-
outputs = [
74-
outfile,
75-
]
65+
outputs = [ outfile ]
7666
lib_switch = "-l"
7767
output_prefix = "lib"
7868
default_output_dir = "{{root_out_dir}}/lib"
@@ -88,9 +78,7 @@ template("unix_toolchain") {
8878
default_output_extension = ".so"
8979
}
9080
description = "SOLINK $outfile"
91-
outputs = [
92-
outfile,
93-
]
81+
outputs = [ outfile ]
9482
lib_switch = "-l"
9583
default_output_dir = "{{root_out_dir}}/lib"
9684
}
@@ -103,9 +91,7 @@ template("unix_toolchain") {
10391
command = "$ld {{ldflags}} -o $outfile {{libs}} -Wl,--start-group {{inputs}} -Wl,--end-group"
10492
}
10593
description = "LINK $outfile"
106-
outputs = [
107-
outfile,
108-
]
94+
outputs = [ outfile ]
10995
lib_switch = "-l"
11096

11197
# Setting this allows targets to override the default executable output by
@@ -237,26 +223,20 @@ toolchain("win") {
237223
command = "$cl /nologo /showIncludes /Fo{{output}} /c {{source}} {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
238224
depsformat = "msvc"
239225
description = "CC {{output}}"
240-
outputs = [
241-
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.obj",
242-
]
226+
outputs = [ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.obj" ]
243227
}
244228

245229
tool("cxx") {
246230
command = "$cl /nologo /showIncludes /Fo{{output}} /c {{source}} {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}"
247231
depsformat = "msvc"
248232
description = "CXX {{output}}"
249-
outputs = [
250-
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.obj",
251-
]
233+
outputs = [ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.obj" ]
252234
}
253235

254236
tool("alink") {
255237
command = "$link /lib /nologo {{arflags}} /out:{{output}} {{inputs}}"
256238
description = "LIB {{output}}"
257-
outputs = [
258-
"{{output_dir}}/{{target_output_name}}.lib",
259-
]
239+
outputs = [ "{{output_dir}}/{{target_output_name}}.lib" ]
260240
default_output_dir = "{{root_out_dir}}/lib"
261241
}
262242

@@ -294,9 +274,7 @@ toolchain("win") {
294274
pdbfile = "$outprefix.pdb"
295275
command = "$link /nologo /dll {{ldflags}} /out:$dllfile /pdb:$pdbfile {{libs}} {{inputs}}"
296276
description = "LINK_MODULE $dllfile"
297-
outputs = [
298-
dllfile,
299-
]
277+
outputs = [ dllfile ]
300278
lib_switch = ""
301279
runtime_outputs = outputs
302280
default_output_extension = ".dll"
@@ -310,9 +288,7 @@ toolchain("win") {
310288
pdbfile = "$outprefix.pdb"
311289
command = "$link /nologo {{ldflags}} /out:$outfile /pdb:$pdbfile {{libs}} {{inputs}}"
312290
description = "LINK $outfile"
313-
outputs = [
314-
outfile,
315-
]
291+
outputs = [ outfile ]
316292
lib_switch = ""
317293
default_output_extension = ".exe"
318294

llvm/utils/gn/build/write_cmake_config.gni

+2-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ template("write_cmake_config") {
3030
action(target_name) {
3131
script = "//llvm/utils/gn/build/write_cmake_config.py"
3232

33-
sources = [
34-
invoker.input,
35-
]
36-
outputs = [
37-
invoker.output,
38-
]
33+
sources = [ invoker.input ]
34+
outputs = [ invoker.output ]
3935
args = [
4036
"-o",
4137
rebase_path(outputs[0], root_build_dir),

llvm/utils/gn/build/write_vcsrevision.gni

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ template("write_vcsrevision") {
4141
args += [ "--name=$name" ]
4242
}
4343

44-
outputs = [
45-
header,
46-
]
44+
outputs = [ header ]
4745

4846
forward_variables_from(invoker,
4947
[

llvm/utils/gn/secondary/BUILD.gn

+12-36
Original file line numberDiff line numberDiff line change
@@ -51,64 +51,40 @@ group("default") {
5151
# new locations).
5252
# That seems simpler, more explicit, and good enough.
5353
group("clang") {
54-
deps = [
55-
"//clang/tools/driver:symlinks",
56-
]
54+
deps = [ "//clang/tools/driver:symlinks" ]
5755
}
5856
group("lld") {
59-
deps = [
60-
"//lld/tools/lld:symlinks",
61-
]
57+
deps = [ "//lld/tools/lld:symlinks" ]
6258
}
6359
group("llvm-ar") {
64-
deps = [
65-
"//llvm/tools/llvm-ar:symlinks",
66-
]
60+
deps = [ "//llvm/tools/llvm-ar:symlinks" ]
6761
}
6862
group("llvm-dwp") {
69-
deps = [
70-
"//llvm/tools/llvm-dwp:symlinks",
71-
]
63+
deps = [ "//llvm/tools/llvm-dwp:symlinks" ]
7264
}
7365
group("llvm-nm") {
74-
deps = [
75-
"//llvm/tools/llvm-nm:symlinks",
76-
]
66+
deps = [ "//llvm/tools/llvm-nm:symlinks" ]
7767
}
7868
group("llvm-cxxfilt") {
79-
deps = [
80-
"//llvm/tools/llvm-cxxfilt:symlinks",
81-
]
69+
deps = [ "//llvm/tools/llvm-cxxfilt:symlinks" ]
8270
}
8371
group("llvm-objcopy") {
84-
deps = [
85-
"//llvm/tools/llvm-objcopy:symlinks",
86-
]
72+
deps = [ "//llvm/tools/llvm-objcopy:symlinks" ]
8773
}
8874
group("llvm-objdump") {
89-
deps = [
90-
"//llvm/tools/llvm-objdump:symlinks",
91-
]
75+
deps = [ "//llvm/tools/llvm-objdump:symlinks" ]
9276
}
9377
group("llvm-readobj") {
94-
deps = [
95-
"//llvm/tools/llvm-readobj:symlinks",
96-
]
78+
deps = [ "//llvm/tools/llvm-readobj:symlinks" ]
9779
}
9880
group("llvm-size") {
99-
deps = [
100-
"//llvm/tools/llvm-size:symlinks",
101-
]
81+
deps = [ "//llvm/tools/llvm-size:symlinks" ]
10282
}
10383
group("llvm-strings") {
104-
deps = [
105-
"//llvm/tools/llvm-strings:symlinks",
106-
]
84+
deps = [ "//llvm/tools/llvm-strings:symlinks" ]
10785
}
10886
group("llvm-symbolizer") {
109-
deps = [
110-
"//llvm/tools/llvm-symbolizer:symlinks",
111-
]
87+
deps = [ "//llvm/tools/llvm-symbolizer:symlinks" ]
11288
}
11389

11490
# A pool called "console" in the root BUILD.gn is magic and represents ninja's

llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn

+2-6
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,13 @@ action("check-clangd") {
9595
rebase_path(get_path_info(clangd_lit_unit_site_cfg_file, "dir"),
9696
root_out_dir),
9797
]
98-
outputs = [
99-
"$target_gen_dir/run-lit", # Non-existing, so that ninja runs it each time.
100-
]
98+
outputs = [ "$target_gen_dir/run-lit" ] # Non-existing, so that ninja runs it each time.
10199

102100
# Since check-clangd is always dirty, //:default doesn't depend on it so
103101
# that it's not part of the default ninja target. Hence, check-clangd
104102
# shouldn't have any deps except :test. so that the default target is sure to
105103
# build all the deps.
106-
deps = [
107-
":test",
108-
]
104+
deps = [ ":test" ]
109105
testonly = true
110106

111107
pool = "//:console"

llvm/utils/gn/secondary/clang-tools-extra/clangd/xpc/framework/BUILD.gn

+16-48
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,15 @@ write_cmake_config("XPCServiceInfo.plist") {
2121
}
2222

2323
bundle_data("clangxpc_bundle_xpc_service_info_plist") {
24-
public_deps = [
25-
":XPCServiceInfo.plist",
26-
]
27-
sources = [
28-
"$target_gen_dir/XPCServiceInfo.plist",
29-
]
30-
outputs = [
31-
"{{bundle_contents_dir}}/Info.plist",
32-
]
24+
public_deps = [ ":XPCServiceInfo.plist" ]
25+
sources = [ "$target_gen_dir/XPCServiceInfo.plist" ]
26+
outputs = [ "{{bundle_contents_dir}}/Info.plist" ]
3327
}
3428

3529
bundle_data("clangxpc_bundle_xpc_service_executable") {
36-
public_deps = [
37-
"//clang-tools-extra/clangd/tool:clangd",
38-
]
39-
sources = [
40-
"$root_out_dir/bin/clangd",
41-
]
42-
outputs = [
43-
"{{bundle_executable_dir}}/{{source_file_part}}",
44-
]
30+
public_deps = [ "//clang-tools-extra/clangd/tool:clangd" ]
31+
sources = [ "$root_out_dir/bin/clangd" ]
32+
outputs = [ "{{bundle_executable_dir}}/{{source_file_part}}" ]
4533
}
4634

4735
create_bundle("clangd.xpc") {
@@ -68,49 +56,29 @@ write_cmake_config("Info.plist") {
6856
}
6957

7058
bundle_data("clangdxpc_bundle_info_plist") {
71-
public_deps = [
72-
":Info.plist",
73-
]
74-
sources = [
75-
"$target_gen_dir/Info.plist",
76-
]
77-
outputs = [
78-
"{{bundle_resources_dir}}/{{source_file_part}}",
79-
]
59+
public_deps = [ ":Info.plist" ]
60+
sources = [ "$target_gen_dir/Info.plist" ]
61+
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
8062
}
8163

8264
shared_library("ClangdXPCLib") {
83-
deps = [
84-
"//clang-tools-extra/clangd/tool:clangd",
85-
]
65+
deps = [ "//clang-tools-extra/clangd/tool:clangd" ]
8666
sources = [
8767
# Make `gn format` not collapse this, for sync_source_lists_from_cmake.py.
8868
"ClangdXPC.cpp",
8969
]
9070
}
9171

9272
bundle_data("clangdxpc_bundle_executable") {
93-
public_deps = [
94-
":ClangdXPCLib",
95-
]
96-
sources = [
97-
"$root_out_dir/lib/libClangdXPCLib.dylib",
98-
]
99-
outputs = [
100-
"{{bundle_executable_dir}}/ClangdXPC",
101-
]
73+
public_deps = [ ":ClangdXPCLib" ]
74+
sources = [ "$root_out_dir/lib/libClangdXPCLib.dylib" ]
75+
outputs = [ "{{bundle_executable_dir}}/ClangdXPC" ]
10276
}
10377

10478
bundle_data("clangdxpc_bundle_xpc") {
105-
public_deps = [
106-
":clangd.xpc",
107-
]
108-
sources = [
109-
"$target_gen_dir/clangd.xpc",
110-
]
111-
outputs = [
112-
"{{bundle_contents_dir}}/XPCServices/{{source_file_part}}",
113-
]
79+
public_deps = [ ":clangd.xpc" ]
80+
sources = [ "$target_gen_dir/clangd.xpc" ]
81+
outputs = [ "{{bundle_contents_dir}}/XPCServices/{{source_file_part}}" ]
11482
}
11583

11684
# .framework bundle symlinks:

llvm/utils/gn/secondary/clang-tools-extra/test/BUILD.gn

+2-6
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,13 @@ action("check-clang-tools") {
9898
rebase_path(clang_tools_extra_lit_unit_site_cfg_file, root_out_dir),
9999
rebase_path(".", root_out_dir),
100100
]
101-
outputs = [
102-
"$target_gen_dir/run-lit", # Non-existing, so that ninja runs it each time.
103-
]
101+
outputs = [ "$target_gen_dir/run-lit" ] # Non-existing, so that ninja runs it each time.
104102

105103
# Since check-clang-tools is always dirty, //:default doesn't depend on it so
106104
# that it's not part of the default ninja target. Hence, check-clang-tools
107105
# shouldn't have any deps except :test. so that the default target is sure to
108106
# build all the deps.
109-
deps = [
110-
":test",
111-
]
107+
deps = [ ":test" ]
112108
testonly = true
113109

114110
pool = "//:console"

0 commit comments

Comments
 (0)