Skip to content

Commit 27d2f99

Browse files
committed
Corrected set initializations
The same Lit tests are produced as the last commit
1 parent 9c2112d commit 27d2f99

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

clang/test/Driver/flang/unsupported_in_flang.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! NOTE: This lit test was automatically generated to validate unintentionally exposed arguments to various driver flavours.
22
! NOTE: To make changes, see llvm-project/clang/utils/generate_unsupported_in_drivermode.py from which it was generated.
33
! NOTE: Regenerate this Lit test with the following:
4-
! NOTE: python llvm-project/clang/utils/generate_unsupported_in_drivermode.py llvm-project/clang/include/clang/Driver/Options.td --llvm-bin llvm-project/build/bin --llvm-tblgen llvm-tblgen
4+
! NOTE: python generate_unsupported_in_drivermode.py llvm-project/clang/include/clang/Driver/Options.td --llvm-bin llvm-project/build/bin --llvm-tblgen llvm-tblgen
55

66
! RUN: not %clang --driver-mode=flang -fc1 -A -A- -B -C -CC -EB -EL -Eonly -F -faapcs-bitfield-load -G -G= -H -K -L -M -MD -MF -MG -MJ -MM -MMD -MP -MQ -MT -MV -Mach -Q -Qn -Qunused-arguments -Qy -T -V -X -Xanalyzer -Xarch_ -Xarch_device -Xarch_host -Xassembler -Xclang -Xcuda-fatbinary -Xcuda-ptxas -Xflang -Xlinker -Xoffload-linker -Xopenmp-target -Xopenmp-target= -Xpreprocessor -Z -Z-Xlinker-no-demangle -Z-reserved-lib-cckext -Z-reserved-lib-stdc++ -Zlinker-input --CLASSPATH --CLASSPATH= -- -### /AI /Brepro /Brepro- /Bt /Bt+ /C /EH /EP /F /FA /FC /FI /FR /FS /FU /Fa /Fd /Fe /Fe: /Fi /Fi: /Fm /Fo /Fo: /Fp /Fp: /Fr /Fx /G1 /G2 /GA /GF /GF- /GH /GL /GL- /GR /GR- /GS /GS- /GT /GX /GX- - < /dev/null 2>&1 | FileCheck -check-prefix=FC1OptionCHECK-COUNT-100 %s
77

clang/test/Driver/unsupported_in_drivermode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// NOTE: This lit test was automatically generated to validate unintentionally exposed arguments to various driver flavours.
22
// NOTE: To make changes, see llvm-project/clang/utils/generate_unsupported_in_drivermode.py from which it was generated.
33
// NOTE: Regenerate this Lit test with the following:
4-
// NOTE: python llvm-project/clang/utils/generate_unsupported_in_drivermode.py llvm-project/clang/include/clang/Driver/Options.td --llvm-bin llvm-project/build/bin --llvm-tblgen llvm-tblgen
4+
// NOTE: python generate_unsupported_in_drivermode.py llvm-project/clang/include/clang/Driver/Options.td --llvm-bin llvm-project/build/bin --llvm-tblgen llvm-tblgen
55

66
// RUN: not %clang -cc1as -A -A- -B -C -CC -D -E -EB -EL -Eonly -F -faapcs-bitfield-load -G -G= -H -J -K -L -M -MD -MF -MG -MJ -MM -MMD -MP -MQ -MT -MV -Mach -O -O0 -O4 -O -ObjC -ObjC++ -Ofast -P -Q -Qn -Qunused-arguments -Qy -R -Rpass= -Rpass-analysis= -Rpass-missed= -S -T -U -V -WCL4 -W -Wa, -Wall -Wdeprecated -Wframe-larger-than -Wframe-larger-than= -Winvalid-constexpr -Winvalid-gnu-asm-cast -Wl, -Wlarge-by-value-copy= -Wlarge-by-value-copy -Wlarger-than- -Wlarger-than= -Wno-deprecated -Wno-invalid-constexpr -Wno-nonportable-cfstrings -Wno-rewrite-macros -Wno-system-headers -Wno-write-strings -Wnonportable-cfstrings -Wp, -Wsystem-headers -Wsystem-headers-in-module= -Wundef-prefix= -Wwrite-strings -X -Xanalyzer -Xarch_ -Xarch_device -Xarch_host -Xassembler -Xclang -Xcuda-fatbinary -Xcuda-ptxas -Xflang -Xlinker -Xoffload-linker -Xopenmp-target -Xopenmp-target= -Xpreprocessor -Z -Z-Xlinker-no-demangle -Z-reserved-lib-cckext -Z-reserved-lib-stdc++ -Zlinker-input --CLASSPATH --CLASSPATH= -- -### - < /dev/null 2>&1 | FileCheck -check-prefix=CC1AsOptionCHECK-COUNT-100 %s
77

clang/utils/generate_unsupported_in_drivermode.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,11 @@ def find_groups(options_dictionary, option):
120120
Return: A set including the group found for the option
121121
"""
122122
group_list = options_dictionary[option]["Group"]
123-
group_set = set()
124123

125124
if group_list is None:
126125
return None
127126
found_group = group_list["def"]
128-
group_set.add(found_group)
127+
group_set = {found_group}
129128

130129
sub_group_set = find_groups(options_dictionary, found_group)
131130
if sub_group_set is None:
@@ -169,7 +168,7 @@ def get_lit_test_note(test_visibility):
169168
f"{test_prefix}NOTE: To make changes, see llvm-project/clang/utils/generate_unsupported_in_drivermode.py"
170169
+ " from which it was generated.\n"
171170
f"{test_prefix}NOTE: Regenerate this Lit test with the following:\n"
172-
f"{test_prefix}NOTE: python llvm-project/clang/utils/generate_unsupported_in_drivermode.py "
171+
f"{test_prefix}NOTE: python generate_unsupported_in_drivermode.py "
173172
+ "llvm-project/clang/include/clang/Driver/Options.td --llvm-bin llvm-project/build/bin --llvm-tblgen llvm-tblgen\n\n"
174173
)
175174

@@ -371,7 +370,7 @@ def validate_file(path):
371370
# Iterate the options list and find which drivers shouldn't be visible to each option
372371
for option in options_dictionary["!instanceof"]["Option"]:
373372
kind = options_dictionary[option]["Kind"]["def"]
374-
tmp_visibility_set = set()
373+
tmp_visibility_set = set(())
375374
option_name = options_dictionary[option]["Name"]
376375

377376
# There are a few conditions that make an option unsuitable to test in this script
@@ -432,9 +431,9 @@ def validate_file(path):
432431
driver_data.supported_sequence.sort(key=len, reverse=True)
433432

434433
# For a given driver, this script cannot generate tests for unsupported options whose option "Name" have a prefix that
435-
# corresponds to a supported option / visible option of Kind *JOINED*. These driver-option pairs are removed here.
434+
# corresponds to a supported/visible option of Kind *JOINED*. These driver-option pairs are removed here.
436435
# The reason is that those options will be parsed as if they were the corresponding prefixed options with a value,
437-
# and thus would not error would be triggered.
436+
# and thus no error would be triggered.
438437
# Example: Option "O_flag" is not visible to FlangOption, but option "O" is visible to FlangOption.
439438
# Attempting to test this:
440439
# clang --driver-mode=flang -O_flag -### -x c++ -c - < /dev/null 2>&1

0 commit comments

Comments
 (0)