Don't use -ffunction-sections -fdata-sections on debug builds.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 14:34:43 +0000 (14:34 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 14:34:43 +0000 (14:34 +0000)
commit29072c8fab85f090d0482074c1d7bbb4565de8fd
tree229085abf3ee391956bd10ba916d56238bcb662c
parent0aa299a45445105d4ae44dd1315a6e8a406d22f7
Don't use -ffunction-sections -fdata-sections on debug builds.

Unfortunately, on ELF there is not used attribute on the .o files,
so there is no easy way to keep the dump function alive.

If we are not gcing, we may as well produce non gcable files and
avoid the cost.

Linking a debug clang now takes 18.856225992 seconds, before it
took 21.206897447.

I will try avoiding --gc-sections -O3 on a followup patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234159 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/HandleLLVMOptions.cmake