Skip to content

Only print validation warnings when actually triggering an assertion. #1989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,10 +1189,6 @@ template <> bool Equivalent<CompilerType>(CompilerType l, CompilerType r) {
/// matching that name.
template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
if (l != r) {
// Failure. Dump it for easier debugging.
llvm::dbgs() << "TypeSystemSwiftTypeRef diverges from SwiftASTContext: "
<< l.GetStringRef() << " != " << r.GetStringRef() << "\n";

// For some reason the Swift type dumper doesn't attach a module
// name to the AnyObject protocol, and only that one.
std::string l_prime = std::regex_replace(
Expand Down Expand Up @@ -1225,7 +1221,11 @@ template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
if (llvm::StringRef(l_prime) == r.GetStringRef())
return true;

#ifndef STRICT_VALIDATION
#ifdef STRICT_VALIDATION
// Failure. Dump it for easier debugging.
llvm::dbgs() << "TypeSystemSwiftTypeRef diverges from SwiftASTContext: "
<< l.GetStringRef() << " != " << r.GetStringRef() << "\n";
#else
return true;
#endif
}
Expand Down