@@ -52,6 +52,10 @@ def CC1AsOption : OptionFlag;
52
52
// NoDriverOption - This option should not be accepted by the driver.
53
53
def NoDriverOption : OptionFlag;
54
54
55
+ // If an option affects linking, but has a primary group (so Link_Group cannot
56
+ // be used), add this flag.
57
+ def LinkOption : OptionFlag;
58
+
55
59
// A short name to show in documentation. The name will be interpreted as rST.
56
60
class DocName<string name> { string DocName = name; }
57
61
@@ -573,7 +577,7 @@ def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[DriverOp
573
577
HelpText<"System directory for configuration files">;
574
578
def config_user_dir_EQ : Joined<["--"], "config-user-dir=">, Flags<[DriverOption, HelpHidden]>,
575
579
HelpText<"User directory for configuration files">;
576
- def coverage : Flag<["-", "--"], "coverage">, Flags<[CoreOption]>;
580
+ def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>, Flags<[CoreOption]>;
577
581
def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
578
582
def current__version : JoinedOrSeparate<["-"], "current_version">;
579
583
def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
@@ -1747,7 +1751,7 @@ def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
1747
1751
HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">;
1748
1752
defm preserve_as_comments : OptOutFFlag<"preserve-as-comments", "",
1749
1753
"Do not preserve comments in inline assembly">;
1750
- def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>;
1754
+ def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>, Flags<[LinkOption]> ;
1751
1755
def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group<f_Group>;
1752
1756
def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
1753
1757
def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
@@ -2724,7 +2728,7 @@ def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>;
2724
2728
def nostdlibinc : Flag<["-"], "nostdlibinc">;
2725
2729
def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>,
2726
2730
HelpText<"Disable standard #include directories for the C++ standard library">;
2727
- def nostdlib : Flag<["-"], "nostdlib">;
2731
+ def nostdlib : Flag<["-"], "nostdlib">, Group<Link_Group> ;
2728
2732
def nostdlibxx : Flag<["-"], "nostdlib++">;
2729
2733
def object : Flag<["-"], "object">;
2730
2734
def o : JoinedOrSeparate<["-"], "o">, Flags<[DriverOption, RenderAsInput, CC1Option, CC1AsOption]>,
@@ -2768,15 +2772,15 @@ def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>,
2768
2772
HelpText<"Support POSIX threads in generated code">;
2769
2773
def no_pthread : Flag<["-"], "no-pthread">, Flags<[CC1Option]>;
2770
2774
def p : Flag<["-"], "p">;
2771
- def pie : Flag<["-"], "pie">;
2772
- def static_pie : Flag<["-"], "static-pie">;
2775
+ def pie : Flag<["-"], "pie">, Group<Link_Group> ;
2776
+ def static_pie : Flag<["-"], "static-pie">, Group<Link_Group> ;
2773
2777
def read__only__relocs : Separate<["-"], "read_only_relocs">;
2774
2778
def remap : Flag<["-"], "remap">;
2775
2779
def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[DriverOption,CC1Option]>,
2776
2780
HelpText<"Rewrite Objective-C source to C++">, Group<Action_Group>;
2777
2781
def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">, Flags<[DriverOption]>,
2778
2782
HelpText<"Rewrite Legacy Objective-C source to C++">;
2779
- def rdynamic : Flag<["-"], "rdynamic">;
2783
+ def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group> ;
2780
2784
def resource_dir : Separate<["-"], "resource-dir">,
2781
2785
Flags<[DriverOption, CC1Option, CoreOption, HelpHidden]>,
2782
2786
HelpText<"The directory which holds the compiler resource files">;
@@ -2818,13 +2822,13 @@ def segs__read__only__addr : Separate<["-"], "segs_read_only_addr">;
2818
2822
def segs__read__write__addr : Separate<["-"], "segs_read_write_addr">;
2819
2823
def segs__read__ : Joined<["-"], "segs_read_">;
2820
2824
def shared_libgcc : Flag<["-"], "shared-libgcc">;
2821
- def shared : Flag<["-", "--"], "shared">;
2825
+ def shared : Flag<["-", "--"], "shared">, Group<Link_Group> ;
2822
2826
def single__module : Flag<["-"], "single_module">;
2823
2827
def specs_EQ : Joined<["-", "--"], "specs=">;
2824
2828
def specs : Separate<["-", "--"], "specs">, Flags<[Unsupported]>;
2825
2829
def static_libgcc : Flag<["-"], "static-libgcc">;
2826
2830
def static_libstdcxx : Flag<["-"], "static-libstdc++">;
2827
- def static : Flag<["-", "--"], "static">, Flags<[NoArgumentUnused]>;
2831
+ def static : Flag<["-", "--"], "static">, Group<Link_Group>, Flags<[NoArgumentUnused]>;
2828
2832
def std_default_EQ : Joined<["-"], "std-default=">;
2829
2833
def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option]>,
2830
2834
Group<CompileOnly_Group>, HelpText<"Language standard to compile for">,
@@ -3283,8 +3287,8 @@ defm : BooleanFFlag<"keep-inline-functions">, Group<clang_ignored_gcc_optimizati
3283
3287
3284
3288
def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group<f_Group>;
3285
3289
3286
- def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>, Flags<[CoreOption]>;
3287
- def ld_path_EQ : Joined<["--"], "ld-path=">;
3290
+ def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>, Flags<[CoreOption, LinkOption ]>;
3291
+ def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group> ;
3288
3292
3289
3293
defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
3290
3294
def falign_labels_EQ : Joined<["-"], "falign-labels=">, Group<clang_ignored_gcc_optimization_f_Group>;
0 commit comments