<div dir="ltr"><div style>That failed:</div><div style><a href="http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4081/steps/make/logs/stdio">http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4081/steps/make/logs/stdio</a><br>
</div><div><br></div>It looks like this was a clang bug (rdar://10253857) fixed in r161767.<div><br></div><div style>Probably the best workaround is just to check for __clang__.</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Mon, Jul 8, 2013 at 12:39 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Prospective fix in r185833.<div><br></div><div>I can't reproduce the bot problem locally when building clang with a ~month-old clang.  Is there anything special about that bot?  Is it building with a clang from XCode, maybe?</div>

<div><br></div><div>I also didn't receive any mail or IRC notifications about the failure.  Is that a known issue?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Jul 8, 2013 at 12:08 PM, David Dean <span dir="ltr"><<a href="mailto:david_dean@apple.com" target="_blank">david_dean@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This commit has broken some of the buildbots:<br>
<br>
<a href="http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4079" target="_blank">http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4079</a><br>


<br>
/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/llvm/include/llvm/Support/Compiler.h:204:5: error: builtin feature check macro requires a parenthesized identifier<br>


#if __has_attribute(const) || defined(__GNUC__)<br>
    ^<br>
/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/llvm/include/llvm/Support/Compiler.h:204:26: error: expected end of line in preprocessor expression<br>
<br>
Please fix or revert as soon as you can.<br>
<div><div><br>
On 8 Jul 2013, at 8:31 AM, Reid Kleckner <<a href="mailto:reid@kleckner.net" target="_blank">reid@kleckner.net</a>> wrote:<br>
<br>
> Author: rnk<br>
> Date: Mon Jul  8 10:31:29 2013<br>
> New Revision: 185831<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=185831&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=185831&view=rev</a><br>
> Log:<br>
> Use Clang's __has_* macros in Compiler.h to test for features<br>
><br>
> When targetting Windows, clang does not define __GNUC__, and as a result<br>
> we don't use our attributes with it.  This leads to warnings about<br>
> unused functions that are already annotated with LLVM_ATTRIBUTE_UNUSED.<br>
> Rather than testing for __clang__, we can use its __has_attribute and<br>
> __has_builtin macros directlty.<br>
><br>
> While I'm here, conditionally define and use __GNUC_PREREQ for gcc<br>
> version checks.  Spelling the check out with three comparisons is<br>
> verbose and error prone.<br>
><br>
> Reviewers: aaron.ballman<br>
><br>
> Differential Revision: <a href="http://llvm-reviews.chandlerc.com/D1080" target="_blank">http://llvm-reviews.chandlerc.com/D1080</a><br>
><br>
> Modified:<br>
>    llvm/trunk/include/llvm/Support/Compiler.h<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/Compiler.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=185831&r1=185830&r2=185831&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=185831&r1=185830&r2=185831&view=diff</a><br>


> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/Compiler.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/Compiler.h Mon Jul  8 10:31:29 2013<br>
> @@ -21,6 +21,25 @@<br>
> # define __has_feature(x) 0<br>
> #endif<br>
><br>
> +#ifndef __has_attribute<br>
> +# define __has_attribute(x) 0<br>
> +#endif<br>
> +<br>
> +#ifndef __has_builtin<br>
> +# define __has_builtin(x) 0<br>
> +#endif<br>
> +<br>
> +/// \macro __GNUC_PREREQ<br>
> +/// \brief Defines __GNUC_PREREQ if glibc's features.h isn't available.<br>
> +#ifndef __GNUC_PREREQ<br>
> +# if defined(__GNUC__) && defined(__GNUC_MINOR__)<br>
> +#  define __GNUC_PREREQ(maj, min) \<br>
> +    ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))<br>
> +# else<br>
> +#  define __GNUC_PREREQ(maj, min) 0<br>
> +# endif<br>
> +#endif<br>
> +<br>
> /// \brief Does the compiler support r-value references?<br>
> /// This implies that <utility> provides the one-argument std::move;  it<br>
> /// does not imply the existence of any other C++ library features.<br>
> @@ -146,13 +165,15 @@<br>
> /// into a shared library, then the class should be private to the library and<br>
> /// not accessible from outside it.  Can also be used to mark variables and<br>
> /// functions, making them private to any shared library they are linked into.<br>
> -#if (__GNUC__ >= 4) && !defined(__MINGW32__) && !defined(__CYGWIN__)<br>
> +/// On PE/COFF targets, library visibility is the default, so this isn't needed.<br>
> +#if (__has_attribute(visibility) || __GNUC_PREREQ(4, 0)) &&                    \<br>
> +    !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(LLVM_ON_WIN32)<br>
> #define LLVM_LIBRARY_VISIBILITY __attribute__ ((visibility("hidden")))<br>
> #else<br>
> #define LLVM_LIBRARY_VISIBILITY<br>
> #endif<br>
><br>
> -#if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))<br>
> +#if __has_attribute(used) || __GNUC_PREREQ(3, 1)<br>
> #define LLVM_ATTRIBUTE_USED __attribute__((__used__))<br>
> #else<br>
> #define LLVM_ATTRIBUTE_USED<br>
> @@ -166,31 +187,35 @@<br>
> // more portable solution:<br>
> //   (void)unused_var_name;<br>
> // Prefer cast-to-void wherever it is sufficient.<br>
> -#if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))<br>
> +#if __has_attribute(unused) || __GNUC_PREREQ(3, 1)<br>
> #define LLVM_ATTRIBUTE_UNUSED __attribute__((__unused__))<br>
> #else<br>
> #define LLVM_ATTRIBUTE_UNUSED<br>
> #endif<br>
><br>
> -#if (__GNUC__ >= 4) && !defined(__MINGW32__) && !defined(__CYGWIN__)<br>
> +// FIXME: Provide this for PE/COFF targets.<br>
> +#if (__has_attribute(weak) || __GNUC_PREREQ(4, 0)) &&                          \<br>
> +    (!defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(LLVM_ON_WIN32))<br>
> #define LLVM_ATTRIBUTE_WEAK __attribute__((__weak__))<br>
> #else<br>
> #define LLVM_ATTRIBUTE_WEAK<br>
> #endif<br>
><br>
> -#ifdef __GNUC__ // aka 'CONST' but following LLVM Conventions.<br>
> +#if __has_attribute(const) || defined(__GNUC__)<br>
> +// aka 'CONST' but following LLVM Conventions.<br>
> #define LLVM_READNONE __attribute__((__const__))<br>
> #else<br>
> #define LLVM_READNONE<br>
> #endif<br>
><br>
> -#ifdef __GNUC__  // aka 'PURE' but following LLVM Conventions.<br>
> +#if __has_attribute(pure) || defined(__GNUC__)<br>
> +// aka 'PURE' but following LLVM Conventions.<br>
> #define LLVM_READONLY __attribute__((__pure__))<br>
> #else<br>
> #define LLVM_READONLY<br>
> #endif<br>
><br>
> -#if (__GNUC__ >= 4)<br>
> +#if __has_builtin(__builtin_expect) || __GNUC_PREREQ(4, 0)<br>
> #define LLVM_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true)<br>
> #define LLVM_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)<br>
> #else<br>
> @@ -213,7 +238,7 @@<br>
><br>
> /// LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so,<br>
> /// mark a method "not for inlining".<br>
> -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))<br>
> +#if __has_attribute(noinline) || __GNUC_PREREQ(3, 4)<br>
> #define LLVM_ATTRIBUTE_NOINLINE __attribute__((noinline))<br>
> #elif defined(_MSC_VER)<br>
> #define LLVM_ATTRIBUTE_NOINLINE __declspec(noinline)<br>
> @@ -225,7 +250,7 @@<br>
> /// so, mark a method "always inline" because it is performance sensitive. GCC<br>
> /// 3.4 supported this but is buggy in various cases and produces unimplemented<br>
> /// errors, just use it in GCC 4.0 and later.<br>
> -#if __GNUC__ > 3<br>
> +#if __has_attribute(always_inline) || __GNUC_PREREQ(4, 0)<br>
> #define LLVM_ATTRIBUTE_ALWAYS_INLINE inline __attribute__((always_inline))<br>
> #elif defined(_MSC_VER)<br>
> #define LLVM_ATTRIBUTE_ALWAYS_INLINE __forceinline<br>
> @@ -267,8 +292,7 @@<br>
> /// LLVM_BUILTIN_UNREACHABLE - On compilers which support it, expands<br>
> /// to an expression which states that it is undefined behavior for the<br>
> /// compiler to reach this point.  Otherwise is not defined.<br>
> -#if defined(__clang__) || (__GNUC__ > 4) \<br>
> - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)<br>
> +#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ(4, 5)<br>
> # define LLVM_BUILTIN_UNREACHABLE __builtin_unreachable()<br>
> #elif defined(_MSC_VER)<br>
> # define LLVM_BUILTIN_UNREACHABLE __assume(false)<br>
> @@ -276,8 +300,7 @@<br>
><br>
> /// LLVM_BUILTIN_TRAP - On compilers which support it, expands to an expression<br>
> /// which causes the program to exit abnormally.<br>
> -#if defined(__clang__) || (__GNUC__ > 4) \<br>
> - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)<br>
> +#if __has_builtin(__builtin_trap) || __GNUC_PREREQ(4, 3)<br>
> # define LLVM_BUILTIN_TRAP __builtin_trap()<br>
> #else<br>
> # define LLVM_BUILTIN_TRAP *(volatile int*)0x11 = 0<br>
> @@ -285,11 +308,10 @@<br>
><br>
> /// \macro LLVM_ASSUME_ALIGNED<br>
> /// \brief Returns a pointer with an assumed alignment.<br>
> -#if !defined(__clang__) && ((__GNUC__ > 4) \<br>
> - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))<br>
> -// FIXME: Enable on clang when it supports it.<br>
> +#if __has_builtin(__builtin_assume_aligned) && __GNUC_PREREQ(4, 7)<br>
> # define LLVM_ASSUME_ALIGNED(p, a) __builtin_assume_aligned(p, a)<br>
> #elif defined(LLVM_BUILTIN_UNREACHABLE)<br>
> +// As of today, clang does not support __builtin_assume_aligned.<br>
> # define LLVM_ASSUME_ALIGNED(p, a) \<br>
>            (((uintptr_t(p) % (a)) == 0) ? (p) : (LLVM_BUILTIN_UNREACHABLE, (p)))<br>
> #else<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div><span><font color="#888888">-David<br>
</font></span><div><div><br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>