diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-06-05 18:03:58 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-06-05 18:03:58 +0000 |
| commit | cdffc36c119a7933c3e8871ccd0028f41d5b5feb (patch) | |
| tree | 1fd4d7df8ca04e1445257ac4e60a0e3ff545d09c /clang/lib/Headers | |
| parent | 6679fc1a791ed1f673be9143ed5a07755ae80767 (diff) | |
| download | bcm5719-llvm-cdffc36c119a7933c3e8871ccd0028f41d5b5feb.tar.gz bcm5719-llvm-cdffc36c119a7933c3e8871ccd0028f41d5b5feb.zip | |
[AST] There is no message for C++1z-style static_assert
We would crash in the DeclPrinter trying to pretty-print the
static_assert message. C++1z-style assertions don't have a message so
we would crash.
This fixes PR23756.
llvm-svn: 239170
Diffstat (limited to 'clang/lib/Headers')
| -rw-r--r-- | clang/lib/Headers/Intrin.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/Headers/Intrin.h b/clang/lib/Headers/Intrin.h index 727a55e5b76..9592cccb15c 100644 --- a/clang/lib/Headers/Intrin.h +++ b/clang/lib/Headers/Intrin.h @@ -546,13 +546,8 @@ _bittestandset(long *a, long b) { #if defined(__i386__) || defined(__x86_64__) static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__)) _interlockedbittestandset(long volatile *__BitBase, long __BitPos) { - unsigned char __Res; - __asm__ ("xor %0, %0\n" - "lock bts %2, %1\n" - "setc %0\n" - : "=r" (__Res), "+m"(*__BitBase) - : "Ir"(__BitPos)); - return __Res; + long __OldVal = __atomic_fetch_or(__BitBase, 1 << __BitPos, 5); + return (__OldVal >> __BitPos) & 1; } #endif #ifdef __x86_64__ |

