summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Driver/Options.td2
-rw-r--r--clang/lib/Driver/Tools.cpp3
-rw-r--r--clang/test/Driver/debug-options.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index b74165a9ff4..c0e4c4988e2 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -790,6 +790,8 @@ def ffunction_sections: Flag <["-"], "ffunction-sections">, Group<f_Group>,
Flags<[CC1Option]>, HelpText<"Place each function in its own section (ELF Only)">;
def fdata_sections : Flag <["-"], "fdata-sections">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Place each data in its own section (ELF Only)">;
+def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
+ Flags<[CC1Option]>, HelpText<"Place debug types in their own section (ELF Only)">;
def f : Joined<["-"], "f">, Group<f_Group>;
def g_Flag : Flag<["-"], "g">, Group<g_Group>,
HelpText<"Generate source level debug information">, Flags<[CC1Option]>;
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 67ce305893f..add0c623aa2 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -2497,6 +2497,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-split-dwarf=Enable");
}
+
+ Args.AddAllArgs(CmdArgs, options::OPT_fdebug_types_section);
+
Args.AddAllArgs(CmdArgs, options::OPT_ffunction_sections);
Args.AddAllArgs(CmdArgs, options::OPT_fdata_sections);
diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c
index aad97d42c68..fec3f17c48d 100644
--- a/clang/test/Driver/debug-options.c
+++ b/clang/test/Driver/debug-options.c
@@ -21,7 +21,8 @@
// RUN: | FileCheck -check-prefix=GLTO_NO %s
//
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \
-// RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
+// RUN: -gstrict-dwarf -gno-strict-dwarf -fdebug-types-section \
+// RUN: -fno-debug-types-section %s 2>&1 \
// RUN: | FileCheck -check-prefix=GIGNORE %s
//
// G: "-cc1"
OpenPOWER on IntegriCloud