LLVM  8.0.0svn
Classes | Namespaces | Macros | Functions
Verifier.cpp File Reference
#include "llvm/IR/Verifier.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/ilist.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Comdat.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/ConstantRange.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
#include <string>
#include <utility>
#include "llvm/IR/Metadata.def"

Go to the source code of this file.

Classes

struct  llvm::VerifierSupport
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS)   void visit##CLASS(const CLASS &N);
 
#define Assert(C, ...)   do { if (!(C)) { CheckFailed(__VA_ARGS__); return; } } while (false)
 We know that cond should be true, if not print an error message. More...
 
#define AssertDI(C, ...)   do { if (!(C)) { DebugInfoCheckFailed(__VA_ARGS__); return; } } while (false)
 We know that a debug info condition should be true, if not print an error message. More...
 
#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS)
 
#define AssertTBAA(C, ...)
 

Functions

static void forEachUser (const Value *User, SmallPtrSet< const Value *, 32 > &Visited, llvm::function_ref< bool(const Value *)> Callback)
 
static bool isType (const Metadata *MD)
 
static bool isScope (const Metadata *MD)
 
static bool isDINode (const Metadata *MD)
 
static bool hasConflictingReferenceFlags (unsigned Flags)
 Detect mutually exclusive flags. More...
 
static bool isFuncOnlyAttr (Attribute::AttrKind Kind)
 Return true if this attribute kind only applies to functions. More...
 
static bool isFuncOrArgAttr (Attribute::AttrKind Kind)
 Return true if this is a function attribute that can also appear on arguments. More...
 
static InstructiongetSuccPad (TerminatorInst *Terminator)
 
static bool isTypeCongruent (Type *L, Type *R)
 Two types are "congruent" if they are identical, or if they are both pointer types with different pointee types and the same address space. More...
 
static AttrBuilder getParameterABIAttributes (int I, AttributeList Attrs)
 
static bool isContiguous (const ConstantRange &A, const ConstantRange &B)
 
static ValuegetParentPad (Value *EHPad)
 
static DISubprogramgetSubprogram (Metadata *LocalScope)
 Carefully grab the subprogram from a local scope. More...
 
static bool IsRootTBAANode (const MDNode *MD)
 
static bool IsScalarTBAANodeImpl (const MDNode *MD, SmallPtrSetImpl< const MDNode *> &Visited)
 
static bool isNewFormatTBAATypeNode (llvm::MDNode *Type)
 

Macro Definition Documentation

◆ Assert

#define Assert (   C,
  ... 
)    do { if (!(C)) { CheckFailed(__VA_ARGS__); return; } } while (false)

We know that cond should be true, if not print an error message.

Definition at line 526 of file Verifier.cpp.

Referenced by forEachUser(), getParameterABIAttributes(), getParentPad(), getSubprogram(), getSuccPad(), hasConflictingReferenceFlags(), isContiguous(), and isFuncOrArgAttr().

◆ AssertDI

#define AssertDI (   C,
  ... 
)    do { if (!(C)) { DebugInfoCheckFailed(__VA_ARGS__); return; } } while (false)

We know that a debug info condition should be true, if not print an error message.

Definition at line 531 of file Verifier.cpp.

Referenced by forEachUser(), getParentPad(), getSubprogram(), getSuccPad(), hasConflictingReferenceFlags(), and isDINode().

◆ AssertTBAA

#define AssertTBAA (   C,
  ... 
)
Value:
do { \
if (!(C)) { \
CheckFailed(__VA_ARGS__); \
return false; \
} \
} while (false)
uint64_t CallInst * C

Definition at line 4751 of file Verifier.cpp.

Referenced by llvm::TBAAVerifier::visitTBAAMetadata().

◆ HANDLE_SPECIALIZED_MDNODE_LEAF [1/2]

#define HANDLE_SPECIALIZED_MDNODE_LEAF (   CLASS)    void visit##CLASS(const CLASS &N);

Definition at line 419 of file Verifier.cpp.

◆ HANDLE_SPECIALIZED_MDNODE_LEAF [2/2]

#define HANDLE_SPECIALIZED_MDNODE_LEAF (   CLASS)
Value:
case Metadata::CLASS##Kind: \
visit##CLASS(cast<CLASS>(MD)); \
break;
const unsigned Kind

Definition at line 419 of file Verifier.cpp.

Function Documentation

◆ forEachUser()

static void forEachUser ( const Value User,
SmallPtrSet< const Value *, 32 > &  Visited,
llvm::function_ref< bool(const Value *)>  Callback 
)
static

Definition at line 543 of file Verifier.cpp.

References A, assert(), Assert, AssertDI, C, llvm::VerifierSupport::CheckFailed(), llvm::VerifierSupport::Context, llvm::dyn_cast(), F(), llvm::FunctionType::get(), llvm::GlobalAlias::getAliasee(), llvm::GlobalValue::getAlignment(), llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getLinkage(), llvm::GlobalObject::getMetadata(), llvm::MetadataAsValue::getMetadata(), llvm::Metadata::getMetadataID(), llvm::Value::getName(), llvm::NamedMDNode::getName(), llvm::StructType::getNumElements(), llvm::GlobalValue::getParent(), llvm::Type::getPointerTo(), llvm::Value::getType(), llvm::GlobalValue::getType(), llvm::CompositeType::getTypeAtIndex(), llvm::ValueAsMetadata::getValue(), llvm::GlobalValue::getValueType(), llvm::Type::getVoidTy(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalObject::hasComdat(), llvm::GlobalValue::hasComdat(), llvm::GlobalValue::hasCommonLinkage(), llvm::GlobalValue::hasDefaultVisibility(), llvm::GlobalValue::hasDLLImportStorageClass(), llvm::GlobalValue::hasExternalLinkage(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::GlobalVariable::hasInitializer(), llvm::GlobalValue::hasLocalLinkage(), llvm::Value::hasName(), llvm::GlobalValue::hasValidDeclarationLinkage(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Type::isArrayTy(), llvm::GlobalVariable::isConstant(), llvm::GlobalValue::isDeclaration(), llvm::GlobalValue::isDeclarationForLinker(), llvm::GlobalValue::isDSOLocal(), llvm::Type::isIntegerTy(), llvm::Type::isMetadataTy(), llvm::Constant::isNullValue(), llvm::Type::isPointerTy(), llvm::MDNode::isResolved(), llvm::MDNode::isTemporary(), llvm::GlobalAlias::isValidLinkage(), llvm_unreachable, llvm::VerifierSupport::M, llvm::Value::materialized_users(), llvm::Value::MaximumAlignment, llvm::LLVMContext::MD_dbg, N, llvm::User::operands(), llvm::MDNode::operands(), llvm::NamedMDNode::operands(), and llvm::StringRef::startswith().

◆ getParameterABIAttributes()

static AttrBuilder getParameterABIAttributes ( int  I,
AttributeList  Attrs 
)
static

Definition at line 2884 of file Verifier.cpp.

References llvm::MCID::Add, llvm::AttrBuilder::addAlignmentAttr(), llvm::AttrBuilder::addAttribute(), llvm::all_of(), Assert, B, E, R600_InstFlag::FC, GEP, llvm::AttributeList::getAttributes(), llvm::CallBase< InstTy >::getAttributes(), llvm::CallBase< InstTy >::getCalledFunction(), llvm::CallBase< InstTy >::getCallingConv(), llvm::CallBase< InstTy >::getFunctionType(), llvm::GetElementPtrInst::getIndexedType(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::FunctionType::getNumParams(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::CallBase< InstTy >::getOperand(), llvm::AttributeList::getParamAlignment(), llvm::FunctionType::getParamType(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GetElementPtrInst::getPointerOperandType(), llvm::GetElementPtrInst::getResultElementType(), llvm::FunctionType::getReturnType(), llvm::ReturnInst::getReturnValue(), llvm::Type::getScalarType(), llvm::GetElementPtrInst::getSourceElementType(), llvm::Value::getType(), llvm::InvokeInst::getUnwindDest(), llvm::Type::getVectorNumElements(), llvm::AttributeList::hasParamAttribute(), I, llvm::GetElementPtrInst::idx_begin(), llvm::GetElementPtrInst::idx_end(), llvm::ARM_PROC::IE, llvm::BasicBlock::isEHPad(), llvm::Type::isFPOrFPVectorTy(), llvm::CmpInst::isFPPredicate(), llvm::CallInst::isInlineAsm(), llvm::Type::isIntOrIntVectorTy(), llvm::CmpInst::isIntPredicate(), llvm::Function::isIntrinsic(), llvm::CallInst::isMustTailCall(), llvm::Type::isPtrOrPtrVectorTy(), llvm::Type::isSized(), isTypeCongruent(), llvm::ExtractElementInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ShuffleVectorInst::isValidOperands(), llvm::FunctionType::isVarArg(), llvm::Type::isVectorTy(), llvm_unreachable, and llvm::MipsISD::Ret.

◆ getParentPad()

static Value* getParentPad ( Value EHPad)
static

Definition at line 3390 of file Verifier.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, Arg, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::args(), assert(), Assert, AssertDI, llvm::VerifierSupport::CheckFailed(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::countOperandBundlesOfType(), llvm::VerifierSupport::DL, llvm::dyn_cast(), llvm::ArrayRef< T >::empty(), F(), llvm::Function::front(), llvm::ConstantTokenNone::get(), llvm::AllocaInst::getAllocatedType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgOperand(), llvm::DebugLoc::getAsMDNode(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCaller(), llvm::LandingPadInst::getClause(), llvm::Value::getContext(), llvm::Instruction::getDebugLoc(), llvm::GCRelocateInst::getDerivedPtr(), llvm::Function::getEntryBlock(), llvm::BasicBlock::getFirstNonPHI(), llvm::Instruction::getFunction(), llvm::Function::getFunctionType(), llvm::GlobalVariable::getInitializer(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Function::getIntrinsicID(), llvm::Intrinsic::getIntrinsicInfoTableEntries(), llvm::BasicBlock::getLandingPadInst(), llvm::Instruction::getMetadata(), llvm::Intrinsic::getName(), llvm::Value::getName(), llvm::DataLayout::getNonIntegralAddressSpaces(), llvm::InvokeInst::getNormalDest(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getNumArgOperands(), llvm::LandingPadInst::getNumClauses(), llvm::CatchSwitchInst::getNumHandlers(), llvm::User::getNumOperands(), llvm::MDNode::getNumOperands(), llvm::User::getOperand(), llvm::MDNode::getOperand(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::getOperandBundle(), llvm::User::getOperandUse(), llvm::Instruction::getParent(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::FuncletPadInst::getParentPad(), llvm::CatchSwitchInst::getParentPad(), llvm::Function::getReturnType(), llvm::Type::getScalarType(), llvm::APFloat::getSemantics(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::InvokeInst::getUnwindDest(), llvm::CatchSwitchInst::getUnwindDest(), llvm::CleanupReturnInst::getUnwindDest(), llvm::ResumeInst::getValue(), llvm::Type::getVectorNumElements(), llvm::CatchSwitchInst::handlers(), llvm::GlobalVariable::hasDefinitiveInitializer(), llvm::Function::hasGC(), llvm::Value::hasName(), llvm::Function::hasPersonalityFn(), I, llvm::APFloatBase::IEEEsingle(), llvm::AMDGPUISD::IF, llvm::SmallSet< T, N, C >::insert(), llvm::SmallVectorImpl< T >::insert(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isCall(), llvm::LandingPadInst::isCatch(), llvm::LandingPadInst::isCleanup(), llvm::GlobalVariable::isConstant(), llvm::GlobalValue::isDeclaration(), llvm::Instruction::isEHPad(), llvm::LandingPadInst::isFilter(), llvm::APFloat::isFiniteNonZero(), llvm::Type::isFirstClassType(), llvm::Type::isFPOrFPVectorTy(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isInlineAsm(), llvm::Function::isIntrinsic(), llvm::Type::isMetadataTy(), llvm::APFloat::isNegative(), llvm::Type::isPointerTy(), llvm::APInt::isPowerOf2(), llvm::isPowerOf2_32(), llvm::isPowerOf2_64(), llvm::Type::isPtrOrPtrVectorTy(), llvm::isStatepoint(), llvm::AllocaInst::isStaticAlloca(), llvm::FunctionType::isVarArg(), llvm::Type::isVectorTy(), llvm::Type::isVoidTy(), llvm::VerifierSupport::M, llvm::BitmaskEnumDetail::Mask(), llvm::Intrinsic::matchIntrinsicType(), llvm::Intrinsic::matchIntrinsicVarArg(), llvm::max(), llvm::Value::MaximumAlignment, llvm::LLVMContext::MD_align, llvm::LLVMContext::MD_dereferenceable, llvm::LLVMContext::MD_dereferenceable_or_null, llvm::LLVMContext::MD_fpmath, llvm::LLVMContext::MD_nonnull, llvm::LLVMContext::MD_range, llvm::LLVMContext::MD_tbaa, MI, llvm::LLVMContext::OB_deopt, llvm::LLVMContext::OB_funclet, llvm::pred_empty(), llvm::predecessors(), prefetch, Ptr, llvm::Value::stripPointerCasts(), llvm::APInt::ule(), llvm::Value::users(), and llvm::Value::uses().

◆ getSubprogram()

static DISubprogram* getSubprogram ( Metadata LocalScope)
static

Carefully grab the subprogram from a local scope.

This carefully grabs the subprogram from a local scope, avoiding the built-in assertions that would typically fire.

Definition at line 4466 of file Verifier.cpp.

References assert(), Assert, AssertDI, llvm::SmallPtrSetImpl< PtrType >::count(), E, llvm::ConstrainedFPIntrinsic::ebInvalid, F(), llvm::DILocalVariable::getArg(), llvm::CallBase< InstTy >::getArgOperand(), llvm::DebugLoc::getAsMDNode(), llvm::Function::getCallingConv(), llvm::Module::getContext(), llvm::Instruction::getDebugLoc(), llvm::ConstrainedFPIntrinsic::getExceptionBehavior(), llvm::DbgLabelInst::getLabel(), llvm::Module::getNamedMetadata(), llvm::CallBase< InstTy >::getNumArgOperands(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::DbgVariableIntrinsic::getRawExpression(), llvm::DbgLabelInst::getRawLabel(), llvm::DILocation::getRawScope(), llvm::DIVariable::getRawScope(), llvm::DILabel::getRawScope(), llvm::DbgVariableIntrinsic::getRawVariable(), llvm::ConstrainedFPIntrinsic::getRoundingMode(), llvm::DILocalVariable::getScope(), llvm::DILabel::getScope(), llvm::DIVariable::getSizeInBits(), llvm::DILocalScope::getSubprogram(), llvm::DbgVariableIntrinsic::getVariable(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::DILocalVariable::isArtificial(), llvm::LLVMContext::isODRUniquingDebugTypes(), llvm::ConstrainedFPIntrinsic::isTernaryOp(), llvm::ConstrainedFPIntrinsic::isUnaryOp(), Kind, llvm::makeArrayRef(), llvm::DIExpression::FragmentInfo::OffsetInBits, llvm::ConstrainedFPIntrinsic::rmInvalid, and llvm::DIExpression::FragmentInfo::SizeInBits.

◆ getSuccPad()

static Instruction* getSuccPad ( TerminatorInst Terminator)
static

Definition at line 2006 of file Verifier.cpp.

References llvm::CallingConv::AMDGPU_CS, llvm::CallingConv::AMDGPU_GS, llvm::CallingConv::AMDGPU_HS, llvm::CallingConv::AMDGPU_KERNEL, llvm::CallingConv::AMDGPU_PS, llvm::CallingConv::AMDGPU_VS, llvm::SelectInst::areInvalidOperands(), Arg, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_size(), llvm::Function::arg_size(), assert(), Assert, AssertDI, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::CallingConv::C, Callee, llvm::Type::canLosslesslyBitCastTo(), llvm::SwitchInst::cases(), llvm::CastInst::castIsValid(), llvm::SmallPtrSetImplBase::clear(), llvm::SmallVectorImpl< T >::clear(), llvm::CallingConv::Cold, llvm::VerifierSupport::Context, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::VerifierSupport::DL, llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T >::end(), F(), llvm::CallingConv::Fast, first, llvm::BasicBlock::front(), llvm::AttributeList::FunctionIndex, llvm::IndirectBrInst::getAddress(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgument(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getAttributes(), llvm::AttributeList::getAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::BranchInst::getCondition(), llvm::SwitchInst::getCondition(), llvm::Function::getContext(), llvm::Instruction::getDebugLoc(), llvm::IndirectBrInst::getDestination(), llvm::BasicBlock::getFirstNonPHI(), llvm::Instruction::getFunction(), llvm::Function::getFunctionType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getFunctionType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Function::getIntrinsicID(), llvm::Value::getName(), llvm::IndirectBrInst::getNumDestinations(), llvm::SequentialType::getNumElements(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getNumOperandBundles(), llvm::User::getNumOperands(), llvm::FunctionType::getNumParams(), llvm::User::getOperand(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getOperandBundleAt(), llvm::AttributeList::getParamAttributes(), llvm::FunctionType::getParamType(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::Type::getPointerAddressSpace(), llvm::Function::getReturnType(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::Function::getSubprogram(), llvm::DILocalScope::getSubprogram(), llvm::OperandBundleUse::getTagID(), llvm::BasicBlock::getTerminator(), llvm::SelectInst::getTrueValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::BasicBlock::hasAddressTaken(), llvm::AttributeSet::hasAttribute(), llvm::AttributeList::hasAttribute(), llvm::GlobalValue::hasCommonLinkage(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::hasInAllocaArgument(), llvm::AttributeList::hasParamAttribute(), I, llvm::PHINode::incoming_values(), llvm::OperandBundleUse::Inputs, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::CallingConv::Intel_OCL_BI, llvm::BranchInst::isConditional(), llvm::Type::isFirstClassType(), llvm::Type::isFPOrFPVectorTy(), llvm::Type::isIntegerTy(), llvm::Type::isIntOrIntVectorTy(), llvm::Type::isLabelTy(), llvm::Type::isMetadataTy(), llvm::DataLayout::isNonIntegralPointerType(), llvm::Type::isPointerTy(), llvm::Type::isPtrOrPtrVectorTy(), llvm::Function::isSpeculatable(), llvm::Type::isTokenTy(), llvm::Type::isVectorTy(), llvm::Type::isVoidTy(), LLVM_FALLTHROUGH, llvm::BlockAddress::lookup(), llvm::LLVMContext::MD_dbg, llvm::LLVMContext::MD_prof, N, llvm::LLVMContext::OB_deopt, llvm::LLVMContext::OB_funclet, llvm::LLVMContext::OB_gc_transition, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::paramHasAttr(), llvm::BasicBlock::phis(), llvm::pred_begin(), llvm::pred_empty(), llvm::pred_end(), llvm::CallingConv::PTX_Device, llvm::CallingConv::PTX_Kernel, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), second, SI, llvm::SmallVectorBase::size(), llvm::sort(), llvm::CallingConv::SPIR_KERNEL, llvm::StringRef::startswith(), llvm::Value::stripInBoundsOffsets(), llvm::Value::stripPointerCasts(), llvm::Tag, and llvm::MCID::Terminator.

◆ hasConflictingReferenceFlags()

static bool hasConflictingReferenceFlags ( unsigned  Flags)
static

Detect mutually exclusive flags.

Definition at line 928 of file Verifier.cpp.

References llvm::Module::Append, llvm::Module::AppendUnique, Array, assert(), Assert, AssertDI, llvm::VerifierSupport::CheckFailed(), llvm::DIFile::CSK_MD5, llvm::DIFile::CSK_SHA1, D, llvm::StringRef::data(), llvm::dwarf::DW_MACINFO_define, llvm::dwarf::DW_MACINFO_start_file, llvm::dwarf::DW_MACINFO_undef, llvm::dyn_cast(), llvm::StringRef::empty(), Enum, llvm::Module::Error, F(), llvm::DILexicalBlock::getColumn(), llvm::DICompositeType::getElements(), llvm::DIMacroFile::getElements(), llvm::DICompileUnit::getEmissionKind(), llvm::DICompileUnit::getEnumTypes(), llvm::DIGlobalVariableExpression::getExpression(), llvm::DIScope::getFile(), llvm::DIScope::getFilename(), llvm::DIType::getFlags(), llvm::DICompileUnit::getGlobalVariables(), llvm::DICompileUnit::getImportedEntities(), llvm::DILexicalBlock::getLine(), llvm::DIMacroNode::getMacinfoType(), llvm::DICompileUnit::getMacros(), llvm::Module::getModuleFlagsMetadata(), llvm::Comdat::getName(), llvm::DIModule::getName(), llvm::DIVariable::getName(), llvm::DIMacro::getName(), llvm::Module::getNamedMetadata(), llvm::Module::getNamedValue(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::DICompositeType::getRawBaseType(), llvm::DICompositeType::getRawDiscriminator(), llvm::DICompositeType::getRawElements(), llvm::DIMacroFile::getRawElements(), llvm::DIImportedEntity::getRawEntity(), llvm::DICompileUnit::getRawEnumTypes(), llvm::DIScope::getRawFile(), llvm::DIVariable::getRawFile(), llvm::DILabel::getRawFile(), llvm::DIObjCProperty::getRawFile(), llvm::DIMacroFile::getRawFile(), llvm::DICompileUnit::getRawGlobalVariables(), llvm::DICompileUnit::getRawImportedEntities(), llvm::DICompileUnit::getRawMacros(), llvm::DICompileUnit::getRawRetainedTypes(), llvm::DIType::getRawScope(), llvm::DILexicalBlockBase::getRawScope(), llvm::DINamespace::getRawScope(), llvm::DIVariable::getRawScope(), llvm::DILabel::getRawScope(), llvm::DIImportedEntity::getRawScope(), llvm::DIGlobalVariable::getRawStaticDataMemberDeclaration(), llvm::DICompositeType::getRawTemplateParams(), llvm::DITemplateParameter::getRawType(), llvm::DIVariable::getRawType(), llvm::DIObjCProperty::getRawType(), llvm::DISubroutineType::getRawTypeArray(), llvm::DICompositeType::getRawVTableHolder(), llvm::DICompileUnit::getRetainedTypes(), llvm::DINode::getTag(), llvm::DIVariable::getType(), llvm::DISubroutineType::getTypeArray(), llvm::DIMacro::getValue(), llvm::DIGlobalVariableExpression::getVariable(), llvm::GlobalValue::hasPrivateLinkage(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert(), isDINode(), llvm::MDNode::isDistinct(), llvm::isHexDigit(), isScope(), isType(), llvm::DIExpression::isValid(), llvm::Module::isValidModFlagBehavior(), llvm::DIType::isVector(), llvm::DICompileUnit::LastEmissionKind, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), llvm::VerifierSupport::M, llvm::Module::Max, N, llvm::StringRef::npos, llvm::MDNode::operands(), llvm::NamedMDNode::operands(), llvm::Module::Override, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Module::Require, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, T, and llvm::Module::Warning.

◆ isContiguous()

static bool isContiguous ( const ConstantRange A,
const ConstantRange B 
)
static

Definition at line 3139 of file Verifier.cpp.

References llvm::Acquire, llvm::AcquireRelease, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), assert(), Assert, llvm::VerifierSupport::DL, llvm::dyn_cast(), E, llvm::AtomicRMWInst::FIRST_BINOP, llvm::PointerType::getAddressSpace(), llvm::ExtractValueInst::getAggregateOperand(), llvm::InsertValueInst::getAggregateOperand(), llvm::AllocaInst::getAlignment(), llvm::LoadInst::getAlignment(), llvm::StoreInst::getAlignment(), llvm::DataLayout::getAllocaAddrSpace(), llvm::AllocaInst::getAllocatedType(), llvm::AllocaInst::getArraySize(), llvm::PointerType::getElementType(), llvm::AtomicCmpXchgInst::getFailureOrdering(), llvm::ExtractValueInst::getIndexedType(), llvm::ExtractValueInst::getIndices(), llvm::InsertValueInst::getIndices(), llvm::ConstantRange::getLower(), llvm::Instruction::getMetadata(), llvm::MDNode::getNumOperands(), llvm::User::getOperand(), llvm::MDNode::getOperand(), llvm::AtomicRMWInst::getOperation(), llvm::LoadInst::getOrdering(), llvm::StoreInst::getOrdering(), llvm::FenceInst::getOrdering(), llvm::AtomicRMWInst::getOrdering(), llvm::AtomicCmpXchgInst::getSuccessOrdering(), llvm::LoadInst::getSyncScopeID(), llvm::StoreInst::getSyncScopeID(), llvm::AllocaInst::getType(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), llvm::ConstantRange::getUpper(), llvm::ConstantInt::getValue(), High, I, llvm::ConstantRange::intersectWith(), llvm::Instruction::isAtomic(), llvm::ConstantRange::isEmptySet(), llvm::Type::isFloatingPointTy(), llvm::ConstantRange::isFullSet(), llvm::Type::isIntegerTy(), llvm::Type::isIntOrPtrTy(), llvm::Type::isSized(), llvm::isStrongerThan(), llvm::AllocaInst::isSwiftError(), llvm::AtomicRMWInst::LAST_BINOP, llvm::Value::MaximumAlignment, llvm::LLVMContext::MD_range, llvm::NotAtomic, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::paramHasAttr(), llvm::Release, llvm::SequentiallyConsistent, llvm::APInt::sgt(), SI, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, llvm::SyncScope::System, llvm::Unordered, and llvm::Value::users().

◆ isDINode()

static bool isDINode ( const Metadata MD)
static

◆ isFuncOnlyAttr()

static bool isFuncOnlyAttr ( Attribute::AttrKind  Kind)
static

Return true if this attribute kind only applies to functions.

Definition at line 1442 of file Verifier.cpp.

References llvm::CallingConv::Cold, llvm::MCID::Convergent, and llvm::ISD::JumpTable.

Referenced by isFuncOrArgAttr().

◆ isFuncOrArgAttr()

static bool isFuncOrArgAttr ( Attribute::AttrKind  Kind)
static

Return true if this is a function attribute that can also appear on arguments.

Definition at line 1492 of file Verifier.cpp.

References A, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_size(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), Assert, llvm::AMDGPU::HSAMD::Kernel::Key::Attrs, llvm::MCID::Call, llvm::Type::canLosslesslyBitCastTo(), llvm::CastInst::castIsValid(), llvm::VerifierSupport::CheckFailed(), llvm::VerifierSupport::Context, llvm::VerifierSupport::DL, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::doesNotAccessMemory(), llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::AttributeList::FunctionIndex, llvm::AttributeSet::get(), llvm::AttributeList::getAllocSizeArgs(), llvm::CallBase< InstTy >::getArgOperand(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgument(), llvm::AttributeSet::getAsString(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::AttributeList::getFnAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Function::getIntrinsicID(), llvm::AttributeList::getNumAttrSets(), llvm::MDNode::getNumOperands(), llvm::FunctionType::getNumParams(), llvm::ConstantExpr::getOpcode(), llvm::User::getOperand(), llvm::MDNode::getOperand(), llvm::AttributeList::getParamAttributes(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), llvm::AttributeList::getRetAttributes(), llvm::FunctionType::getReturnType(), llvm::MDString::getString(), llvm::Value::getType(), llvm::AttributeSet::hasAttribute(), llvm::AttributeSet::hasAttributes(), llvm::AttributeList::hasAttributes(), llvm::AttributeList::hasFnAttribute(), llvm::GlobalValue::hasGlobalUnnamedAddr(), llvm::AttributeList::isEmpty(), isFuncOnlyAttr(), llvm::isInt< 32 >(), llvm::Type::isIntegerTy(), llvm::DataLayout::isNonIntegralPointerType(), llvm::ISD::JumpTable, llvm::VerifierSupport::M, llvm::MaskAll, llvm::LLVMContext::MD_prof, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::onlyAccessesArgMemory(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::onlyReadsMemory(), llvm::User::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::AttributeFuncs::typeIncompatible(), and llvm::Value::users().

◆ isNewFormatTBAATypeNode()

static bool isNewFormatTBAATypeNode ( llvm::MDNode Type)
static

◆ IsRootTBAANode()

static bool IsRootTBAANode ( const MDNode MD)
static

◆ IsScalarTBAANodeImpl()

static bool IsScalarTBAANodeImpl ( const MDNode MD,
SmallPtrSetImpl< const MDNode *> &  Visited 
)
static

◆ isScope()

static bool isScope ( const Metadata MD)
static

Definition at line 850 of file Verifier.cpp.

Referenced by hasConflictingReferenceFlags(), and isDINode().

◆ isType()

static bool isType ( const Metadata MD)
static

Definition at line 849 of file Verifier.cpp.

Referenced by llvm::DIEHash::addSLEB128(), hasConflictingReferenceFlags(), and isDINode().

◆ isTypeCongruent()

static bool isTypeCongruent ( Type L,
Type R 
)
static

Two types are "congruent" if they are identical, or if they are both pointer types with different pointee types and the same address space.

Definition at line 2874 of file Verifier.cpp.

References llvm::dyn_cast(), llvm::PointerType::getAddressSpace(), llvm::AArch64CC::PL, and llvm::RISCVFenceField::R.

Referenced by getParameterABIAttributes().