Skip to content

Commit 4a04906

Browse files
committed
[lldb] Don't use lldb_assert directly (NFC)
(cherry picked from commit 9b6d7c3)
1 parent 8ba9078 commit 4a04906

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

lldb/source/Plugins/Language/Swift/SwiftUnsafeTypes.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,7 @@ lldb_private::formatters::swift::UnsafeTypeSyntheticFrontEnd::
546546

547547
m_unsafe_ptr = ::SwiftUnsafeType::Create(*valobj_sp.get());
548548

549-
lldb_assert(m_unsafe_ptr != nullptr, "Could not create Swift Unsafe Type",
550-
__FUNCTION__, __FILE__, __LINE__);
549+
lldbassert(m_unsafe_ptr != nullptr && "Could not create Swift Unsafe Type");
551550

552551
if (valobj_sp)
553552
Update();

lldb/source/Plugins/LanguageRuntime/Swift/LLDBMemoryReader.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ LLDBMemoryReader::resolvePointer(swift::remote::RemoteAddress address,
297297
swift::remote::RemoteAbsolutePointer tagged_pointer("", tagged_address);
298298
if (tagged_address !=
299299
(uint64_t)signedPointerStripper(tagged_pointer).getOffset()) {
300-
lldb_assert(false, "Tagged pointer runs into pointer authentication mask!",
301-
__FUNCTION__, __FILE__, __LINE__);
300+
lldbassert(false &&
301+
"Tagged pointer runs into pointer authentication mask!");
302302
return process_pointer;
303303
}
304304

@@ -531,10 +531,9 @@ LLDBMemoryReader::addModuleToAddressMap(ModuleSP module,
531531
(uint64_t)signedPointerStripper(
532532
swift::remote::RemoteAbsolutePointer("", module_end_address))
533533
.getOffset()) {
534-
lldb_assert(false,
535-
"LLDBMemoryReader module to address map ran into pointer "
536-
"authentication mask!",
537-
__FUNCTION__, __FILE__, __LINE__);
534+
lldbassert(false &&
535+
"LLDBMemoryReader module to address map ran into pointer "
536+
"authentication mask!");
538537
return {};
539538
}
540539
// The address for the next image is the next pointer aligned address

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,10 +1941,8 @@ UserExpression *TypeSystemSwiftTypeRefForExpressions::GetUserExpression(
19411941
if (!target_sp)
19421942
return nullptr;
19431943
if (ctx_obj != nullptr) {
1944-
lldb_assert(0,
1945-
"Swift doesn't support 'evaluate in the context"
1946-
" of an object'.",
1947-
__FUNCTION__, __FILE__, __LINE__);
1944+
lldbassert(false &&
1945+
"Swift doesn't support 'evaluate in the context of an object'.");
19481946
return nullptr;
19491947
}
19501948

0 commit comments

Comments
 (0)