|
LLVM 24.0.0git
|
#include "llvm/ABI/TargetInfo.h"#include "llvm/Support/Casting.h"#include <algorithm>#include <cstdint>Go to the source code of this file.
Functions | |
| template<typename To, typename From> | |
| decltype(auto) | dyn_cast (const From &Val) |
| dyn_cast<X> - Return the argument parameter cast to the specified type. | |
|
inlinenodiscard |
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)) { ... }