[Openmp-commits] [openmp] r272590 - Bug fix for Bugzilla bug 26602: Remove function bodies with KMP_ASSERT(0)
Jonathan Peyton via Openmp-commits
openmp-commits at lists.llvm.org
Mon Jun 13 14:33:30 PDT 2016
Author: jlpeyton
Date: Mon Jun 13 16:33:30 2016
New Revision: 272590
URL: http://llvm.org/viewvc/llvm-project?rev=272590&view=rev
Log:
Bug fix for Bugzilla bug 26602: Remove function bodies with KMP_ASSERT(0)
Fix for bugzilla https://llvm.org/bugs/show_bug.cgi?id=26602. Removed functions
body consisted of the only KMP_ASSERT(0) statement. Thus possible runtime crash
converted to compile-time error, which looks preferable (faster possible error
detection).
TODO: consider C++11 static assert as an alternative, that could
make the diagnostics better.
Patch by Andrey Churbanov
Differential Revision: http://reviews.llvm.org/D21304
Modified:
openmp/trunk/runtime/src/kmp_dispatch.cpp
Modified: openmp/trunk/runtime/src/kmp_dispatch.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_dispatch.cpp?rev=272590&r1=272589&r2=272590&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_dispatch.cpp (original)
+++ openmp/trunk/runtime/src/kmp_dispatch.cpp Mon Jun 13 16:33:30 2016
@@ -190,7 +190,7 @@ struct dispatch_shared_info_template {
// test_then_add template (general template should NOT be used)
template< typename T >
static __forceinline T
-test_then_add( volatile T *p, T d ) { KMP_ASSERT(0); };
+test_then_add( volatile T *p, T d );
template<>
__forceinline kmp_int32
@@ -213,7 +213,7 @@ test_then_add< kmp_int64 >( volatile kmp
// test_then_inc_acq template (general template should NOT be used)
template< typename T >
static __forceinline T
-test_then_inc_acq( volatile T *p ) { KMP_ASSERT(0); };
+test_then_inc_acq( volatile T *p );
template<>
__forceinline kmp_int32
@@ -236,7 +236,7 @@ test_then_inc_acq< kmp_int64 >( volatile
// test_then_inc template (general template should NOT be used)
template< typename T >
static __forceinline T
-test_then_inc( volatile T *p ) { KMP_ASSERT(0); };
+test_then_inc( volatile T *p );
template<>
__forceinline kmp_int32
@@ -259,7 +259,7 @@ test_then_inc< kmp_int64 >( volatile kmp
// compare_and_swap template (general template should NOT be used)
template< typename T >
static __forceinline kmp_int32
-compare_and_swap( volatile T *p, T c, T s ) { KMP_ASSERT(0); };
+compare_and_swap( volatile T *p, T c, T s );
template<>
__forceinline kmp_int32
More information about the Openmp-commits
mailing list