Reland "Use Clang's __has_* macros in Compiler.h ..." with fixes
authorReid Kleckner <reid@kleckner.net>
Mon, 8 Jul 2013 19:06:25 +0000 (19:06 +0000)
committerReid Kleckner <reid@kleckner.net>
Mon, 8 Jul 2013 19:06:25 +0000 (19:06 +0000)
commitca4ed882f4b0d9ddb0ed49474ae5e217dde3ab5e
treebf866694620babe70aea70c413ac7bbfabcb135d
parent905dea95bf909c294728c9b407ea0e9f854cdbe4
Reland "Use Clang's __has_* macros in Compiler.h ..." with fixes

This reverts r185841 and relands r185831 without using
__has_attribute(const).

Clang prior to r161767 (between 3.1 and 3.2) does not accept
__has_attribute(const) due to rdar://10253857.  __const and __const__
are both keyword aliases of const, so they don't work either.

I was able to repro the buildbot failure using clang 3.1 and this patch
fixes it.  Various important versions of XCode use clang 2.9-ish, so
this workaround is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185850 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/Compiler.h