diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-27 20:47:30 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-27 20:47:30 +0000 |
commit | 7e2fd943ae4f91c74beeb84cdfbb1499bfcf2ea9 (patch) | |
tree | a335d639a3d2c1cdbd8ef4088cea173f614de8e0 /clang/lib | |
parent | 7400a979521a70be4d69071271e4543014fbfcf5 (diff) | |
download | bcm5719-llvm-7e2fd943ae4f91c74beeb84cdfbb1499bfcf2ea9.tar.gz bcm5719-llvm-7e2fd943ae4f91c74beeb84cdfbb1499bfcf2ea9.zip |
Support for -Wa,-compress-debug-sections.
Also, while I'm here, support -nocompress-debug-sections too.
llvm-svn: 204959
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index eee32925a78..17f5f4d6336 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -443,6 +443,9 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { if (CodeGenOpts.DisableIntegratedAS) Options.DisableIntegratedAS = true; + if (CodeGenOpts.CompressDebugSections) + Options.CompressDebugSections = true; + // Set frame pointer elimination mode. if (!CodeGenOpts.DisableFPElim) { Options.NoFramePointerElim = false; diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 5b997e7d379..756815147c6 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1724,6 +1724,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, // When using an integrated assembler, translate -Wa, and -Xassembler // options. + bool CompressDebugSections = false; for (arg_iterator it = Args.filtered_begin(options::OPT_Wa_COMMA, options::OPT_Xassembler), ie = Args.filtered_end(); it != ie; ++it) { @@ -1749,7 +1750,10 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, CmdArgs.push_back("-mnoexecstack"); } else if (Value == "-compress-debug-sections" || Value == "--compress-debug-sections") { - D.Diag(diag::warn_missing_debug_compression); + CompressDebugSections = true; + } else if (Value == "-nocompress-debug-sections" || + Value == "--nocompress-debug-sections") { + CompressDebugSections = false; } else if (Value.startswith("-I")) { CmdArgs.push_back(Value.data()); // We need to consume the next argument if the current arg is a plain @@ -1762,6 +1766,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, } } } + if (CompressDebugSections) + CmdArgs.push_back("-compress-debug-sections"); } // Until ARM libraries are build separately, we have them all in one library diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index d744865159e..b9706e8263b 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -447,6 +447,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions); Opts.InstrumentForProfiling = Args.hasArg(OPT_pg); Opts.EmitOpenCLArgMetadata = Args.hasArg(OPT_cl_kernel_arg_info); + Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections); Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir); Opts.LinkBitcodeFile = Args.getLastArgValue(OPT_mlink_bitcode_file); Opts.SanitizerBlacklistFile = Args.getLastArgValue(OPT_fsanitize_blacklist); |