summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2022-05-13 15:06:02 +0200
committerAlex Zinenko <zinenko@google.com>2022-05-17 11:15:17 +0200
commit1075c8ca49b467ec5e654a4322fbb36f63e8687f (patch)
treebd16253e1434cc15d3f26a16d546dfa1c0b5b691 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent26593e73147d5d66d87ad1a69faeaad6776b8d1d (diff)
[mlir] support isa/cast/dyn_cast<Operation *>(operation) again
The support for this has been added by 946311b8938114a37db5c9d42fb9f5a1481ccae1 but then ignored by bc22b5c9a2f729460ffdf7627b3534a8d9f3f767. This enables one to write generic code that can be instantiated for both specific operation classes and the common base class without specialization. Examples include functions that take/return ops, such as: ```mlir template <typename FnTy> void applyIf(FnTy &&lambda, ...) { for (Operation *op : ...) { auto specific = dyn_cast<function_traits<FnTy>::template arg_t<0>>(op); if (specific) lambda(specific); } } ``` that would otherwise need to rely on template specialization to support lambdas that take specific operations and those that take `Operation *`. Differential Revision: https://reviews.llvm.org/D125543 Reviewed by: rriddle
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions