Skip to content

Commit 7b54e8b

Browse files
authored
[TBDGen] NFC: print duplicate symbol name before assertion. (#32649)
This facilitates debugging.
1 parent d4bbcf9 commit 7b54e8b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/TBDGen/TBDGen.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ void TBDGenVisitor::addSymbolInternal(StringRef name,
7070
if (StringSymbols && kind == SymbolKind::GlobalSymbol) {
7171
auto isNewValue = StringSymbols->insert(name).second;
7272
(void)isNewValue;
73-
assert(isNewValue && "symbol appears twice");
73+
#ifndef NDEBUG
74+
if (!isNewValue) {
75+
llvm::dbgs() << "TBDGen duplicate symbol: " << name << '\n';
76+
assert(false && "TBDGen symbol appears twice");
77+
}
78+
#endif
7479
}
7580
}
7681

0 commit comments

Comments
 (0)