LLVM 24.0.0git
TargetInfo.cpp File Reference
#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.

Function Documentation

◆ dyn_cast()

template<typename To, typename From>
decltype(auto) llvm::dyn_cast ( const From & Val)
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)) { ... }

Definition at line 643 of file Casting.h.

Referenced by llvm::VPInterleaveBase::classof(), llvm::VPIRPhi::classof(), llvm::VPIRPhi::classof(), llvm::VPPhi::classof(), llvm::VPPhi::classof(), llvm::VPPhi::classof(), llvm::VPReductionRecipe::classof(), llvm::VPSingleDefRecipe::classof(), llvm::sandboxir::Region::createRegionsFromMD(), llvm::ConstantFolder::FoldBinOp(), llvm::TargetFolder::FoldBinOp(), llvm::ConstantFolder::FoldCmp(), llvm::TargetFolder::FoldCmp(), llvm::ConstantFolder::FoldExactBinOp(), llvm::TargetFolder::FoldExactBinOp(), llvm::ConstantFolder::FoldExtractElement(), llvm::TargetFolder::FoldExtractElement(), llvm::ConstantFolder::FoldInsertElement(), llvm::TargetFolder::FoldInsertElement(), llvm::ConstantFolder::FoldInsertValue(), llvm::TargetFolder::FoldInsertValue(), llvm::ConstantFolder::FoldNoWrapBinOp(), llvm::TargetFolder::FoldNoWrapBinOp(), llvm::ConstantFolder::FoldSelect(), llvm::TargetFolder::FoldSelect(), llvm::ConstantFolder::FoldShuffleVector(), llvm::TargetFolder::FoldShuffleVector(), llvm::TargetTransformInfoImplBase::getConstantStrideStep(), and llvm::DDGBuilder::getNodesInPiBlock().