Add support for putting constructors and destructos in explicit comdats.

There are situations when clang knows that the C1 and C2 constructors
or the D1 and D2 destructors are identical. We already optimize some
of these cases, but cannot optimize it when the GlobalValue is
weak_odr.

The problem with weak_odr is that an old TU seeing the same code will
have a C1 and a C2 comdat with the corresponding symbols. We cannot
suddenly start putting the C2 symbol in the C1 comdat as we cannot
guarantee that the linker will not pick a .o with only C1 in it.

The solution implemented by GCC is to expand the ABI to have a comdat
whose name uses a C5/D5 suffix and always has both symbols. That is
what this patch implements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217874 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Restructure and add missing tests.

Patch by Jean-Philippe Dufraigne, Thank you!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217880 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Allow unbroken ::: in inline assembly.

Before:
  asm volatile("nop" :: : "memory");

After:
  asm volatile("nop" ::: "memory");

Patch by Eugene Toder. Thank you.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217883 91177308-0d34-0410-b5e6-96231b3b80d8
Fix forwarding -l to MSVC's link.exe

Translate -lfoo to -lfoo.lib while making sure that -lfoo.lib stays as
-lfoo.lib. Also, these arguments were being passed twice: once
explicitly via AddAllArgs, and again implicitly as linker inputs. Now
they are passed once.

Fixes PR20868.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217895 91177308-0d34-0410-b5e6-96231b3b80d8
Don't try to use C5/D5 comdats in COFF.

This should fix the mingw bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217897 91177308-0d34-0410-b5e6-96231b3b80d8
Don't try to devirtualize non-virtual calls

We would end up marking the vtable of the derived class as used for no
reason. Because the call itself is qualified, it is never virtual, and
the vtable of the derived class isn't helpful. We would end up rejecting
code that MSVC accepts for no benefit.

See http://crbug.com/413478

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217910 91177308-0d34-0410-b5e6-96231b3b80d8
Rebased (adjusting for conflict caused by r217874)
Prep for merge again
Merge branch 'master', remote-tracking branch 'trunk/master'