Skip to content

Commit

Permalink
Merge pull request swiftlang#9302 from adrian-prantl/log-instead-of-a…
Browse files Browse the repository at this point in the history
…ssert

Emit a types log instead of an lldbassert() in SwiftDWARFImporterDele…
  • Loading branch information
adrian-prantl authored Sep 19, 2024
2 parents 8c2a65f + 0099133 commit d781e3c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,14 @@ SwiftDWARFImporterDelegate::SwiftDWARFImporterDelegate(SwiftASTContext &ts)
void SwiftDWARFImporterDelegate::lookupValue(
StringRef name, std::optional<swift::ClangTypeKind> kind,
StringRef inModule, llvm::SmallVectorImpl<clang::Decl *> &results) {
bool suspicious = !name.size() || name[0] > 128;
lldbassert(!suspicious && "SwiftDWARFImporterDelegate asked to look up bogus type name");
if (suspicious)
return;
LLDB_LOG(GetLog(LLDBLog::Types), "{0}::lookupValue(\"{1}\")", m_description,
name.str());
if (!name.size() || name[0] < 0) {
LLDB_LOG(GetLog(LLDBLog::Types),
"SwiftDWARFImporterDelegate was asked to look up a type with a "
"non-ASCII or empty type name");
return;
}
auto clang_importer = m_swift_ast_ctx.GetClangImporter();
if (!clang_importer) {
LLDB_LOG(GetLog(LLDBLog::Types), "no clangimporter");
Expand Down

0 comments on commit d781e3c

Please sign in to comment.