Skip to content

Commit 210fabb

Browse files
committed
SILPrinter: be more tolerant when printing a SILDeclRef with a Decl without name.
1 parent 7388b6c commit 210fabb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SIL/SILPrinter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ static void printFullContext(const DeclContext *Context, raw_ostream &Buffer) {
222222

223223
static void printValueDecl(ValueDecl *Decl, raw_ostream &OS) {
224224
printFullContext(Decl->getDeclContext(), OS);
225-
assert(Decl->hasName());
226225

227-
if (Decl->isOperator()) {
226+
if (!Decl->hasName()) {
227+
OS << "anonname=" << (const void*)Decl;
228+
} else if (Decl->isOperator()) {
228229
OS << '"' << Decl->getBaseName() << '"';
229230
} else {
230231
bool shouldEscape = !Decl->getBaseName().isSpecial() &&

0 commit comments

Comments
 (0)