The TypeID instance was moved in D89153.
It wasn't caught that it broke MLIR pretty printers because pre-merge checks don't run check-debuginfo.
Avoid disabling all MLIR printers in case this happens again by catching the exception.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D90191
self.map = {}
for type_name in self.type_names:
concrete_type = gdb.lookup_type(type_name)
- storage = gdb.parse_and_eval(
- "&'mlir::TypeID::get<%s>()::instance'" % type_name)
+ try:
+ storage = gdb.parse_and_eval(
+ "&'mlir::detail::TypeIDExported::get<%s>()::instance'" % type_name)
+ except gdb.error:
+ # Skip when TypeID instance cannot be found in current context.
+ continue
if concrete_type and storage:
self.map[int(storage)] = concrete_type