From 640884e00a911d9a599dd8fd5dd26cdd96dfc9ea Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 11 Mar 2014 21:05:26 +0000 Subject: [PATCH] Driver: Support -gmlt as an alias for -gline-tables-only git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203603 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 2 ++ lib/Driver/Tools.cpp | 3 ++- test/Driver/debug-options.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 2a48e6f419..b3dd5c3b90 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -900,6 +900,8 @@ def g_Flag : Flag<["-"], "g">, Group, HelpText<"Generate source level debug information">, Flags<[CC1Option]>; def gline_tables_only : Flag<["-"], "gline-tables-only">, Group, HelpText<"Emit debug line number tables only">, Flags<[CC1Option]>; +def gmlt : Flag<["-"], "gmlt">, Group, + HelpText<"Emit debug line number tables only">, Flags<[DriverOption,HelpHidden]>; def g0 : Flag<["-"], "g0">, Group; def g1 : Flag<["-"], "g1">, Group; def g2 : Flag<["-"], "g2">, Group; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index d76ff5cde0..537390a7da 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2693,7 +2693,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // are preserved, all other debug options are substituted with "-g". Args.ClaimAllArgs(options::OPT_g_Group); if (Arg *A = Args.getLastArg(options::OPT_g_Group)) { - if (A->getOption().matches(options::OPT_gline_tables_only)) { + if (A->getOption().matches(options::OPT_gline_tables_only) || + A->getOption().matches(options::OPT_gmlt)) { // FIXME: we should support specifying dwarf version with // -gline-tables-only. CmdArgs.push_back("-gline-tables-only"); diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c index 2ea4990bd0..48f686bb33 100644 --- a/test/Driver/debug-options.c +++ b/test/Driver/debug-options.c @@ -33,6 +33,8 @@ // RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s // RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s // +// RUN: %clang -### -c -gmlt %s 2>&1 \ +// RUN: | FileCheck -check-prefix=GLTO_ONLY %s // RUN: %clang -### -c -gline-tables-only %s 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_ONLY %s // RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \ -- 2.40.0