This is an archive of the discontinued LLVM Phabricator instance.

[AsmPrinter] Make OpAsmPrinter::printFunctionalType be resilient to null values.
ClosedPublic

Authored by lattner on Dec 29 2020, 11:05 AM.

Details

Summary

A previous patch made Value::getType() be resilient to null values which was
considered to be too sweeping. This is a more targeted change which requires
deabstracting some templates.

A middle ground would be to make ValueTypeIterator be tolerant to null values.

Diff Detail

Event Timeline

lattner created this revision.Dec 29 2020, 11:05 AM
lattner requested review of this revision.Dec 29 2020, 11:05 AM
jurahul added inline comments.Dec 29 2020, 11:23 AM
mlir/lib/IR/AsmPrinter.cpp
60

Should this use a different variable name for the "Value op" argument to the lambda since there exists "Operation *op" as well? I was initially confused due to the name reuse here.

rriddle accepted this revision.Jan 5 2021, 2:41 PM
rriddle added inline comments.
mlir/lib/IR/AsmPrinter.cpp
68

nit: Spell out auto here or just inline the op->getNumResults() into the check below.

This revision is now accepted and ready to land.Jan 5 2021, 2:41 PM