Driver: Stub -Wa,-compress-debug-sections support for integrated-as with a suppressable warning

llvm-svn: 199454
This commit is contained in:
David Blaikie 2014-01-17 03:17:40 +00:00
parent 741081708e
commit 372d950a24
4 changed files with 28 additions and 0 deletions

View File

@ -152,6 +152,8 @@ def warn_drv_pch_not_first_include : Warning<
"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">;

View File

@ -1699,6 +1699,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
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 &C, const JobAction &JA,
// 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());

View File

@ -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

View File

@ -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