[PATCH] D72042: [mlir] Update the use-list algorithms in SymbolTable to support nested references.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 14:47:05 PST 2020


rriddle added inline comments.


================
Comment at: mlir/lib/IR/SymbolTable.cpp:29
+    // Check that this is a valid op and isn't an unknown symbol table.
+    if (!from || isPotentiallyUnknownSymbolTable(from))
+      return nullptr;
----------------
jpienaar wrote:
> So we'd have nullptr returned if either a op has no parent or if its parent is a unknown op? This seems sort of difficult to interpret for a caller (e.g., I found no symbol table or I found an unregistered op). Or what should be done when nullptr is returned? [and could you add that to the comment describing the functions]
> 
> Also do we have a test that exercises this?
Error handling is generally left up to the caller, to either assert or emit an error. Added a comment about the failure case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72042/new/

https://reviews.llvm.org/D72042





More information about the llvm-commits mailing list