@@ -7674,10 +7674,10 @@ template <typename... Tys> void TBAAVerifier::CheckFailed(Tys &&... Args) {
7674
7674
// / TBAA scheme. This means \p BaseNode is either a scalar node, or a
7675
7675
// / struct-type node describing an aggregate data structure (like a struct).
7676
7676
TBAAVerifier::TBAABaseNodeSummary
7677
- TBAAVerifier::verifyTBAABaseNode (Instruction & I, const MDNode *BaseNode,
7677
+ TBAAVerifier::verifyTBAABaseNode (const Instruction * I, const MDNode *BaseNode,
7678
7678
bool IsNewFormat) {
7679
7679
if (BaseNode->getNumOperands () < 2 ) {
7680
- CheckFailed (" Base nodes must have at least two operands" , & I, BaseNode);
7680
+ CheckFailed (" Base nodes must have at least two operands" , I, BaseNode);
7681
7681
return {true , ~0u };
7682
7682
}
7683
7683
@@ -7693,8 +7693,8 @@ TBAAVerifier::verifyTBAABaseNode(Instruction &I, const MDNode *BaseNode,
7693
7693
}
7694
7694
7695
7695
TBAAVerifier::TBAABaseNodeSummary
7696
- TBAAVerifier::verifyTBAABaseNodeImpl (Instruction &I, const MDNode *BaseNode ,
7697
- bool IsNewFormat) {
7696
+ TBAAVerifier::verifyTBAABaseNodeImpl (const Instruction *I ,
7697
+ const MDNode *BaseNode, bool IsNewFormat) {
7698
7698
const TBAAVerifier::TBAABaseNodeSummary InvalidNode = {true , ~0u };
7699
7699
7700
7700
if (BaseNode->getNumOperands () == 2 ) {
@@ -7723,7 +7723,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode,
7723
7723
auto *TypeSizeNode = mdconst::dyn_extract_or_null<ConstantInt>(
7724
7724
BaseNode->getOperand (1 ));
7725
7725
if (!TypeSizeNode) {
7726
- CheckFailed (" Type size nodes must be constants!" , & I, BaseNode);
7726
+ CheckFailed (" Type size nodes must be constants!" , I, BaseNode);
7727
7727
return InvalidNode;
7728
7728
}
7729
7729
}
@@ -7749,15 +7749,15 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode,
7749
7749
const MDOperand &FieldTy = BaseNode->getOperand (Idx);
7750
7750
const MDOperand &FieldOffset = BaseNode->getOperand (Idx + 1 );
7751
7751
if (!isa<MDNode>(FieldTy)) {
7752
- CheckFailed (" Incorrect field entry in struct type node!" , & I, BaseNode);
7752
+ CheckFailed (" Incorrect field entry in struct type node!" , I, BaseNode);
7753
7753
Failed = true ;
7754
7754
continue ;
7755
7755
}
7756
7756
7757
7757
auto *OffsetEntryCI =
7758
7758
mdconst::dyn_extract_or_null<ConstantInt>(FieldOffset);
7759
7759
if (!OffsetEntryCI) {
7760
- CheckFailed (" Offset entries must be constants!" , & I, BaseNode);
7760
+ CheckFailed (" Offset entries must be constants!" , I, BaseNode);
7761
7761
Failed = true ;
7762
7762
continue ;
7763
7763
}
@@ -7767,7 +7767,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode,
7767
7767
7768
7768
if (OffsetEntryCI->getBitWidth () != BitWidth) {
7769
7769
CheckFailed (
7770
- " Bitwidth between the offsets and struct type entries must match" , & I,
7770
+ " Bitwidth between the offsets and struct type entries must match" , I,
7771
7771
BaseNode);
7772
7772
Failed = true ;
7773
7773
continue ;
@@ -7782,7 +7782,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode,
7782
7782
!PrevOffset || PrevOffset->ule (OffsetEntryCI->getValue ());
7783
7783
7784
7784
if (!IsAscending) {
7785
- CheckFailed (" Offsets must be increasing!" , & I, BaseNode);
7785
+ CheckFailed (" Offsets must be increasing!" , I, BaseNode);
7786
7786
Failed = true ;
7787
7787
}
7788
7788
@@ -7792,7 +7792,7 @@ TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode,
7792
7792
auto *MemberSizeNode = mdconst::dyn_extract_or_null<ConstantInt>(
7793
7793
BaseNode->getOperand (Idx + 2 ));
7794
7794
if (!MemberSizeNode) {
7795
- CheckFailed (" Member size entries must be constants!" , & I, BaseNode);
7795
+ CheckFailed (" Member size entries must be constants!" , I, BaseNode);
7796
7796
Failed = true ;
7797
7797
continue ;
7798
7798
}
@@ -7844,7 +7844,7 @@ bool TBAAVerifier::isValidScalarTBAANode(const MDNode *MD) {
7844
7844
// / Offset in place to be the offset within the field node returned.
7845
7845
// /
7846
7846
// / We assume we've okayed \p BaseNode via \c verifyTBAABaseNode.
7847
- MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode (Instruction & I,
7847
+ MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode (const Instruction * I,
7848
7848
const MDNode *BaseNode,
7849
7849
APInt &Offset,
7850
7850
bool IsNewFormat) {
@@ -7864,7 +7864,7 @@ MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode(Instruction &I,
7864
7864
mdconst::extract<ConstantInt>(BaseNode->getOperand (Idx + 1 ));
7865
7865
if (OffsetEntryCI->getValue ().ugt (Offset)) {
7866
7866
if (Idx == FirstFieldOpNo) {
7867
- CheckFailed (" Could not find TBAA parent in struct type node" , & I,
7867
+ CheckFailed (" Could not find TBAA parent in struct type node" , I,
7868
7868
BaseNode, &Offset);
7869
7869
return nullptr ;
7870
7870
}
@@ -7893,7 +7893,7 @@ static bool isNewFormatTBAATypeNode(llvm::MDNode *Type) {
7893
7893
return isa_and_nonnull<MDNode>(Type->getOperand (0 ));
7894
7894
}
7895
7895
7896
- bool TBAAVerifier::visitTBAAMetadata (Instruction *I, const MDNode *MD) {
7896
+ bool TBAAVerifier::visitTBAAMetadata (const Instruction *I, const MDNode *MD) {
7897
7897
CheckTBAA (MD->getNumOperands () > 0 , " TBAA metadata cannot have 0 operands" , I,
7898
7898
MD);
7899
7899
@@ -7965,7 +7965,7 @@ bool TBAAVerifier::visitTBAAMetadata(Instruction *I, const MDNode *MD) {
7965
7965
7966
7966
for (/* empty */ ; BaseNode && !IsRootTBAANode (BaseNode);
7967
7967
BaseNode =
7968
- getFieldNodeFromTBAABaseNode (* I, BaseNode, Offset, IsNewFormat)) {
7968
+ getFieldNodeFromTBAABaseNode (I, BaseNode, Offset, IsNewFormat)) {
7969
7969
if (!StructPath.insert (BaseNode).second ) {
7970
7970
CheckFailed (" Cycle detected in struct path" , I, MD);
7971
7971
return false ;
@@ -7974,7 +7974,7 @@ bool TBAAVerifier::visitTBAAMetadata(Instruction *I, const MDNode *MD) {
7974
7974
bool Invalid;
7975
7975
unsigned BaseNodeBitWidth;
7976
7976
std::tie (Invalid, BaseNodeBitWidth) =
7977
- verifyTBAABaseNode (* I, BaseNode, IsNewFormat);
7977
+ verifyTBAABaseNode (I, BaseNode, IsNewFormat);
7978
7978
7979
7979
// If the base node is invalid in itself, then we've already printed all the
7980
7980
// errors we wanted to print.
0 commit comments