diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -2042,7 +2042,10 @@ /// represented as a string prefixed with '@'. The reference is surrounded with /// ""'s and escaped if it has any special or non-printable characters in it. static void printSymbolReference(StringRef symbolRef, raw_ostream &os) { - assert(!symbolRef.empty() && "expected valid symbol reference"); + if (symbolRef.empty()) { + os << "@<>"; + return; + } os << '@'; printKeywordOrString(symbolRef, os); }