File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 22
22
#include " swift/Demangling/Demangle.h"
23
23
#include " swift/Demangling/NamespaceMacros.h"
24
24
25
- #if SWIFT_RUNTIME
25
+ #if !defined(NDEBUG) && ! SWIFT_RUNTIME
26
26
27
- // In the runtime, DEMANGLER_ASSERT() returns an error
27
+ // Except in the runtime, DEMANGLER_ASSERT() works like assert()
28
28
#define DEMANGLER_ASSERT (expr, node ) \
29
29
do { \
30
30
if (!(expr)) \
31
- return ManglingError (ManglingError::AssertionFailed, ( node), __LINE__); \
31
+ swift::Demangle::failAssert (__FILE__, __LINE__, node, #expr); \
32
32
} while (0 )
33
33
34
- #elif !defined(NDEBUG)
34
+ #else
35
35
36
- // If NDEBUG is not defined , DEMANGLER_ASSERT() works like assert()
36
+ // In the runtime and non-asserts builds , DEMANGLER_ASSERT() returns an error
37
37
#define DEMANGLER_ASSERT (expr, node ) \
38
38
do { \
39
39
if (!(expr)) \
40
- swift::Demangle::failAssert (__FILE__, __LINE__, node, #expr); \
40
+ return ManglingError (ManglingError::AssertionFailed, ( node), __LINE__); \
41
41
} while (0 )
42
42
43
- #else
44
-
45
- // Otherwise, DEMANGLER_ASSERT() does nothing
46
- #define DEMANGLER_ASSERT (expr, node )
47
-
48
- #endif // SWIFT_RUNTIME
43
+ #endif // !defined(NDEBUG) && !SWIFT_RUNTIME
49
44
50
45
namespace swift {
51
46
namespace Demangle {
You can’t perform that action at this time.
0 commit comments