Skip to content

Commit 8b1cd37

Browse files
committed
[lldb] Use lldbassert in BuildObjCObjectPointerType
This assert is only checked in Debug builds but ignored in all other builds. This replaces this code with lldbassert which should print a warning to the user in release builds and actually asserts in debug builds. Differential revision: https://reviews.llvm.org/D76697
1 parent 0a51eed commit 8b1cd37

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,12 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
234234

235235
auto types = decl_vendor->FindTypes(ConstString(name), /*max_matches*/ 1);
236236

237-
// The user can forward-declare something that has no definition. The runtime
238-
// doesn't prohibit this at all. This is a rare and very weird case. We keep
239-
// this assert in debug builds so we catch other weird cases.
240-
#ifdef LLDB_CONFIGURATION_DEBUG
241-
assert(!types.empty());
242-
#else
237+
// The user can forward-declare something that has no definition. The runtime
238+
// doesn't prohibit this at all. This is a rare and very weird case. We keep
239+
// this assert in debug builds so we catch other weird cases.
240+
lldbassert(!types.empty());
243241
if (types.empty())
244242
return ast_ctx.getObjCIdType();
245-
#endif
246243

247244
return ClangUtil::GetQualType(types.front().GetPointerType());
248245
} else {

0 commit comments

Comments
 (0)