r199454 - Driver: Stub -Wa, -compress-debug-sections support for integrated-as with a suppressable warning
David Blaikie
dblaikie at gmail.com
Thu Jan 16 19:17:40 PST 2014
Author: dblaikie
Date: Thu Jan 16 21:17:40 2014
New Revision: 199454
URL: http://llvm.org/viewvc/llvm-project?rev=199454&view=rev
Log:
Driver: Stub -Wa,-compress-debug-sections support for integrated-as with a suppressable warning
Modified:
cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/integrated-as.c
cfe/trunk/test/Driver/integrated-as.s
Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=199454&r1=199453&r2=199454&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Thu Jan 16 21:17:40 2014
@@ -152,6 +152,8 @@ def warn_drv_pch_not_first_include : War
"precompiled header '%0' was ignored because '%1' is not first '-include'">;
def warn_missing_sysroot : Warning<"no such sysroot directory: '%0'">,
InGroup<DiagGroup<"missing-sysroot">>;
+def warn_missing_debug_compression : Warning<"DWARF compression is not implemented">,
+ InGroup<DiagGroup<"missing-debug-compression">>;
def note_drv_command_failed_diag_msg : Note<
"diagnostic msg: %0">;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=199454&r1=199453&r2=199454&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jan 16 21:17:40 2014
@@ -1699,6 +1699,8 @@ static void CollectArgsForIntegratedAsse
CmdArgs.push_back("-fatal-assembler-warnings");
} else if (Value == "--noexecstack") {
CmdArgs.push_back("-mnoexecstack");
+ } else if (Value == "-compress-debug-sections") {
+ D.Diag(diag::warn_missing_debug_compression);
} else if (Value.startswith("-I")) {
CmdArgs.push_back(Value.data());
// We need to consume the next argument if the current arg is a plain
@@ -4043,6 +4045,16 @@ void ClangAs::ConstructJob(Compilation &
// FIXME: Add -static support, once we have it.
+ // Consume all the warning flags. Usually this would be handled more
+ // gracefully by -cc1 (warning about unknown warning flags, etc) but -cc1as
+ // doesn't handle that so rather than warning about unused flags that are
+ // actually used, we'll lie by omission instead.
+ // FIXME: Stop lying and consume only the appropriate driver flags
+ for (arg_iterator it = Args.filtered_begin(options::OPT_W_Group),
+ ie = Args.filtered_end();
+ it != ie; ++it)
+ (*it)->claim();
+
CollectArgsForIntegratedAssembler(C, Args, CmdArgs,
getToolChain().getDriver());
Modified: cfe/trunk/test/Driver/integrated-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/integrated-as.c?rev=199454&r1=199453&r2=199454&view=diff
==============================================================================
--- cfe/trunk/test/Driver/integrated-as.c (original)
+++ cfe/trunk/test/Driver/integrated-as.c Thu Jan 16 21:17:40 2014
@@ -2,3 +2,8 @@
// CHECK: cc1as
// CHECK: -mrelax-all
+
+// RUN: %clang -### -c -integrated-as -Wa,-compress-debug-sections -Wno-missing-debug-compression %s 2>&1 | FileCheck --check-prefix=COMPRESS_DEBUG_QUIET %s
+// COMPRESS_DEBUG_QUIET-NOT: warning: DWARF compression is not implemented
+// COMPRESS_DEBUG_QUIET-NOT: warning: argument unused during compilation
+// COMPRESS_DEBUG_QUIET: -cc1
Modified: cfe/trunk/test/Driver/integrated-as.s
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/integrated-as.s?rev=199454&r1=199453&r2=199454&view=diff
==============================================================================
--- cfe/trunk/test/Driver/integrated-as.s (original)
+++ cfe/trunk/test/Driver/integrated-as.s Thu Jan 16 21:17:40 2014
@@ -31,3 +31,12 @@
// RUN: %clang -### -c -integrated-as %s -Xassembler -Ifoo_dir 2>&1 | FileCheck --check-prefix=XA_INCLUDE2 %s
// XA_INCLUDE2: cc1as
// XA_INCLUDE2: "-Ifoo_dir"
+
+// RUN: %clang -### -c -integrated-as -Wa,-compress-debug-sections %s 2>&1 | FileCheck --check-prefix=COMPRESS_DEBUG %s
+// COMPRESS_DEBUG: warning: DWARF compression is not implemented
+// COMPRESS_DEBUG: -cc1as
+
+// RUN: %clang -### -c -integrated-as -Wa,-compress-debug-sections -Wno-missing-debug-compression %s 2>&1 | FileCheck --check-prefix=COMPRESS_DEBUG_QUIET %s
+// COMPRESS_DEBUG_QUIET-NOT: warning: DWARF compression is not implemented
+// COMPRESS_DEBUG_QUIET-NOT: warning: argument unused during compilation
+// COMPRESS_DEBUG_QUIET: -cc1as
More information about the cfe-commits
mailing list