ΒΆtemplate <typename To, typename From>
inline decltype(auto) dyn_cast(const From& Val)
template <typename To, typename From>
inline decltype(auto) dyn_cast(const From& Val)
Description
dyn_cast <X > - Return the argument parameter cast to the specified type. This casting operator returns null if the argument is of the wrong type, so it can be used to test for a type as well as cast if successful. The value passed in must be present, if not, use dyn_cast_if_present. This should be used in the context of an if statement like this: if (const Instruction *I = dyn_cast <Instruction >(myVal)) { ... }
Declared at: llvm/include/llvm/Support/Casting.h:597
Templates
- To
- From
Parameters
- const From& Val