MaskRay updated this revision to Diff 310331. MaskRay added a comment. Test there is no -ggnu-pubnames
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92809/new/ https://reviews.llvm.org/D92809 Files: clang/include/clang/Driver/Options.td clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/split-debug.c Index: clang/test/Driver/split-debug.c =================================================================== --- clang/test/Driver/split-debug.c +++ clang/test/Driver/split-debug.c @@ -17,12 +17,22 @@ // RUN: %clang -### -c -target amdgcn-amd-amdhsa -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT /// -gsplit-dwarf is a no-op on a non-ELF platform. -// RUN: %clang -### -c -target x86_64-apple-darwin -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=NOSPLIT -// NOSPLIT-NOT: "-split-dwarf +// RUN: %clang -### -c -target x86_64-apple-darwin -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=DARWIN +// DARWIN: "-debug-info-kind=standalone" +// DARWIN-NOT: "-split-dwarf /// -gsplit-dwarf is a no-op if no -g is specified. // RUN: %clang -### -c -target x86_64 -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefix=G0 +/// -gno-split-dwarf disables debug fission. +// RUN: %clang -### -c -target x86_64 -gsplit-dwarf -g -gno-split-dwarf %s 2>&1 | FileCheck %s --check-prefix=NOSPLIT +// RUN: %clang -### -c -target x86_64 -gsplit-dwarf=single -g -gno-split-dwarf %s 2>&1 | FileCheck %s --check-prefix=NOSPLIT +// RUN: %clang -### -c -target x86_64 -gno-split-dwarf -g -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefixes=NOINLINE,SPLIT + +// NOSPLIT: "-debug-info-kind=limited" +// NOSPLIT-NOT: "-ggnu-pubnames" +// NOSPLIT-NOT: "-split-dwarf + /// Test -gsplit-dwarf=single. // RUN: %clang -### -c -target x86_64 -gsplit-dwarf=single -g %s 2>&1 | FileCheck %s --check-prefix=SINGLE Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3705,9 +3705,9 @@ static DwarfFissionKind getDebugFissionKind(const Driver &D, const ArgList &Args, Arg *&Arg) { - Arg = - Args.getLastArg(options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ); - if (!Arg) + Arg = Args.getLastArg(options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ, + options::OPT_gno_split_dwarf); + if (!Arg || Arg->getOption().matches(options::OPT_gno_split_dwarf)) return DwarfFissionKind::None; if (Arg->getOption().matches(options::OPT_gsplit_dwarf)) Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -2213,6 +2213,7 @@ def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>, HelpText<"Set DWARF fission mode to either 'split' or 'single'">, Values<"split,single">; +def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>; def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>; def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>; def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
Index: clang/test/Driver/split-debug.c =================================================================== --- clang/test/Driver/split-debug.c +++ clang/test/Driver/split-debug.c @@ -17,12 +17,22 @@ // RUN: %clang -### -c -target amdgcn-amd-amdhsa -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT /// -gsplit-dwarf is a no-op on a non-ELF platform. -// RUN: %clang -### -c -target x86_64-apple-darwin -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=NOSPLIT -// NOSPLIT-NOT: "-split-dwarf +// RUN: %clang -### -c -target x86_64-apple-darwin -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=DARWIN +// DARWIN: "-debug-info-kind=standalone" +// DARWIN-NOT: "-split-dwarf /// -gsplit-dwarf is a no-op if no -g is specified. // RUN: %clang -### -c -target x86_64 -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefix=G0 +/// -gno-split-dwarf disables debug fission. +// RUN: %clang -### -c -target x86_64 -gsplit-dwarf -g -gno-split-dwarf %s 2>&1 | FileCheck %s --check-prefix=NOSPLIT +// RUN: %clang -### -c -target x86_64 -gsplit-dwarf=single -g -gno-split-dwarf %s 2>&1 | FileCheck %s --check-prefix=NOSPLIT +// RUN: %clang -### -c -target x86_64 -gno-split-dwarf -g -gsplit-dwarf %s 2>&1 | FileCheck %s --check-prefixes=NOINLINE,SPLIT + +// NOSPLIT: "-debug-info-kind=limited" +// NOSPLIT-NOT: "-ggnu-pubnames" +// NOSPLIT-NOT: "-split-dwarf + /// Test -gsplit-dwarf=single. // RUN: %clang -### -c -target x86_64 -gsplit-dwarf=single -g %s 2>&1 | FileCheck %s --check-prefix=SINGLE Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3705,9 +3705,9 @@ static DwarfFissionKind getDebugFissionKind(const Driver &D, const ArgList &Args, Arg *&Arg) { - Arg = - Args.getLastArg(options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ); - if (!Arg) + Arg = Args.getLastArg(options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ, + options::OPT_gno_split_dwarf); + if (!Arg || Arg->getOption().matches(options::OPT_gno_split_dwarf)) return DwarfFissionKind::None; if (Arg->getOption().matches(options::OPT_gsplit_dwarf)) Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -2213,6 +2213,7 @@ def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>, HelpText<"Set DWARF fission mode to either 'split' or 'single'">, Values<"split,single">; +def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>; def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>; def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>; def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits