diff options
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 6ff9693..b2e76cc 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -7674,10 +7674,10 @@ template <typename... Tys> void TBAAVerifier::CheckFailed(Tys &&... Args) { /// TBAA scheme. This means \p BaseNode is either a scalar node, or a /// struct-type node describing an aggregate data structure (like a struct). TBAAVerifier::TBAABaseNodeSummary -TBAAVerifier::verifyTBAABaseNode(Instruction &I, const MDNode *BaseNode, +TBAAVerifier::verifyTBAABaseNode(const Instruction *I, const MDNode *BaseNode, bool IsNewFormat) { if (BaseNode->getNumOperands() < 2) { - CheckFailed("Base nodes must have at least two operands", &I, BaseNode); + CheckFailed("Base nodes must have at least two operands", I, BaseNode); return {true, ~0u}; } @@ -7693,8 +7693,8 @@ TBAAVerifier::verifyTBAABaseNode(Instruction &I, const MDNode *BaseNode, } TBAAVerifier::TBAABaseNodeSummary -TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, - bool IsNewFormat) { +TBAAVerifier::verifyTBAABaseNodeImpl(const Instruction *I, + const MDNode *BaseNode, bool IsNewFormat) { const TBAAVerifier::TBAABaseNodeSummary InvalidNode = {true, ~0u}; if (BaseNode->getNumOperands() == 2) { @@ -7723,7 +7723,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, auto *TypeSizeNode = mdconst::dyn_extract_or_null<ConstantInt>( BaseNode->getOperand(1)); if (!TypeSizeNode) { - CheckFailed("Type size nodes must be constants!", &I, BaseNode); + CheckFailed("Type size nodes must be constants!", I, BaseNode); return InvalidNode; } } @@ -7749,7 +7749,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, const MDOperand &FieldTy = BaseNode->getOperand(Idx); const MDOperand &FieldOffset = BaseNode->getOperand(Idx + 1); if (!isa<MDNode>(FieldTy)) { - CheckFailed("Incorrect field entry in struct type node!", &I, BaseNode); + CheckFailed("Incorrect field entry in struct type node!", I, BaseNode); Failed = true; continue; } @@ -7757,7 +7757,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, auto *OffsetEntryCI = mdconst::dyn_extract_or_null<ConstantInt>(FieldOffset); if (!OffsetEntryCI) { - CheckFailed("Offset entries must be constants!", &I, BaseNode); + CheckFailed("Offset entries must be constants!", I, BaseNode); Failed = true; continue; } @@ -7767,7 +7767,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, if (OffsetEntryCI->getBitWidth() != BitWidth) { CheckFailed( - "Bitwidth between the offsets and struct type entries must match", &I, + "Bitwidth between the offsets and struct type entries must match", I, BaseNode); Failed = true; continue; @@ -7782,7 +7782,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, !PrevOffset || PrevOffset->ule(OffsetEntryCI->getValue()); if (!IsAscending) { - CheckFailed("Offsets must be increasing!", &I, BaseNode); + CheckFailed("Offsets must be increasing!", I, BaseNode); Failed = true; } @@ -7792,7 +7792,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode, auto *MemberSizeNode = mdconst::dyn_extract_or_null<ConstantInt>( BaseNode->getOperand(Idx + 2)); if (!MemberSizeNode) { - CheckFailed("Member size entries must be constants!", &I, BaseNode); + CheckFailed("Member size entries must be constants!", I, BaseNode); Failed = true; continue; } @@ -7844,7 +7844,7 @@ bool TBAAVerifier::isValidScalarTBAANode(const MDNode *MD) { /// Offset in place to be the offset within the field node returned. /// /// We assume we've okayed \p BaseNode via \c verifyTBAABaseNode. -MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode(Instruction &I, +MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode(const Instruction *I, const MDNode *BaseNode, APInt &Offset, bool IsNewFormat) { @@ -7864,7 +7864,7 @@ MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode(Instruction &I, mdconst::extract<ConstantInt>(BaseNode->getOperand(Idx + 1)); if (OffsetEntryCI->getValue().ugt(Offset)) { if (Idx == FirstFieldOpNo) { - CheckFailed("Could not find TBAA parent in struct type node", &I, + CheckFailed("Could not find TBAA parent in struct type node", I, BaseNode, &Offset); return nullptr; } @@ -7893,7 +7893,7 @@ static bool isNewFormatTBAATypeNode(llvm::MDNode *Type) { return isa_and_nonnull<MDNode>(Type->getOperand(0)); } -bool TBAAVerifier::visitTBAAMetadata(Instruction *I, const MDNode *MD) { +bool TBAAVerifier::visitTBAAMetadata(const Instruction *I, const MDNode *MD) { CheckTBAA(MD->getNumOperands() > 0, "TBAA metadata cannot have 0 operands", I, MD); @@ -7965,7 +7965,7 @@ bool TBAAVerifier::visitTBAAMetadata(Instruction *I, const MDNode *MD) { for (/* empty */; BaseNode && !IsRootTBAANode(BaseNode); BaseNode = - getFieldNodeFromTBAABaseNode(*I, BaseNode, Offset, IsNewFormat)) { + getFieldNodeFromTBAABaseNode(I, BaseNode, Offset, IsNewFormat)) { if (!StructPath.insert(BaseNode).second) { CheckFailed("Cycle detected in struct path", I, MD); return false; @@ -7974,7 +7974,7 @@ bool TBAAVerifier::visitTBAAMetadata(Instruction *I, const MDNode *MD) { bool Invalid; unsigned BaseNodeBitWidth; std::tie(Invalid, BaseNodeBitWidth) = - verifyTBAABaseNode(*I, BaseNode, IsNewFormat); + verifyTBAABaseNode(I, BaseNode, IsNewFormat); // If the base node is invalid in itself, then we've already printed all the // errors we wanted to print. |