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 @@ -44,8 +44,8 @@ #include "llvm/Support/SaveAndRestore.h" #include "llvm/Support/Threading.h" -#include #include +#include using namespace mlir; using namespace mlir::detail; @@ -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); }