diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-01-07 00:32:04 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-01-07 00:32:04 +0000 |
commit | 4e480206b288d82c5cb525e739d39da346c64c55 (patch) | |
tree | a21fe3c75a6c59f902c11588c01a7050ed0df8ca /clang/lib/Driver/Tools.cpp | |
parent | 5ae84fec4c441622cbc6f27280b61996d9b14e16 (diff) | |
download | llvm-4e480206b288d82c5cb525e739d39da346c64c55.zip llvm-4e480206b288d82c5cb525e739d39da346c64c55.tar.gz llvm-4e480206b288d82c5cb525e739d39da346c64c55.tar.bz2 |
[WebAssembly] Only enable --gc-sections when optimizations are enabled.
Also, revamp the wasm-toolchain.c test and add a test to ensure that
a user-supplied --no-gc-sections comes after --gc-sections.
llvm-svn: 257004
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 598ebc9..0236e61 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -6537,7 +6537,8 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA, // Enable garbage collection of unused input sections by default, since code // size is of particular importance. - CmdArgs.push_back("--gc-sections"); + if (areOptimizationsEnabled(Args)) + CmdArgs.push_back("--gc-sections"); AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs); CmdArgs.push_back("-o"); |