Skip to content

Commit ef4906d

Browse files
committed
Only print validation warnings when actually triggering an assertion.
1 parent 98050f7 commit ef4906d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,10 +1189,6 @@ template <> bool Equivalent<CompilerType>(CompilerType l, CompilerType r) {
11891189
/// matching that name.
11901190
template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
11911191
if (l != r) {
1192-
// Failure. Dump it for easier debugging.
1193-
llvm::dbgs() << "TypeSystemSwiftTypeRef diverges from SwiftASTContext: "
1194-
<< l.GetStringRef() << " != " << r.GetStringRef() << "\n";
1195-
11961192
// For some reason the Swift type dumper doesn't attach a module
11971193
// name to the AnyObject protocol, and only that one.
11981194
std::string l_prime = std::regex_replace(
@@ -1225,7 +1221,11 @@ template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
12251221
if (llvm::StringRef(l_prime) == r.GetStringRef())
12261222
return true;
12271223

1228-
#ifndef STRICT_VALIDATION
1224+
#ifdef STRICT_VALIDATION
1225+
// Failure. Dump it for easier debugging.
1226+
llvm::dbgs() << "TypeSystemSwiftTypeRef diverges from SwiftASTContext: "
1227+
<< l.GetStringRef() << " != " << r.GetStringRef() << "\n";
1228+
#else
12291229
return true;
12301230
#endif
12311231
}

0 commit comments

Comments
 (0)