Skip to content
Commit 77c9fe5c authored by Reid Kleckner's avatar Reid Kleckner
Browse files

Use Clang's __has_* macros in Compiler.h to test for features

When targetting Windows, clang does not define __GNUC__, and as a result
we don't use our attributes with it.  This leads to warnings about
unused functions that are already annotated with LLVM_ATTRIBUTE_UNUSED.
Rather than testing for __clang__, we can use its __has_attribute and
__has_builtin macros directlty.

While I'm here, conditionally define and use __GNUC_PREREQ for gcc
version checks.  Spelling the check out with three comparisons is
verbose and error prone.

Reviewers: aaron.ballman

Differential Revision: http://llvm-reviews.chandlerc.com/D1080

llvm-svn: 185831
parent 9a780156
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment