Skip to content

Commit ab3f0a4

Browse files
committed
[lldb] Fix VALIDATE_AND_RETURN for non-assert build
The call to Equivalent was moved out of the assert and is guarded by
1 parent 6d510c8 commit ab3f0a4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
11211121
#endif
11221122

11231123
// This can be removed once the transition is complete.
1124+
#ifndef NDEBUG
11241125
#define VALIDATE_AND_RETURN(IMPL, REFERENCE, TYPE, ARGS) \
11251126
do { \
11261127
auto result = IMPL(); \
@@ -1135,6 +1136,13 @@ template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
11351136
"TypeSystemSwiftTypeRef diverges from SwiftASTContext"); \
11361137
return result; \
11371138
} while (0)
1139+
#else
1140+
#define VALIDATE_AND_RETURN(IMPL, REFERENCE, TYPE, ARGS) \
1141+
do { \
1142+
auto result = IMPL(); \
1143+
return result; \
1144+
} while (0)
1145+
#endif
11381146

11391147
CompilerType
11401148
TypeSystemSwiftTypeRef::RemangleAsType(swift::Demangle::Demangler &Dem,

0 commit comments

Comments
 (0)