[llvm] r290712 - [TBAAVerifier] Make things const-consistent; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 29 07:47:01 PST 2016
Author: sanjoy
Date: Thu Dec 29 09:47:01 2016
New Revision: 290712
URL: http://llvm.org/viewvc/llvm-project?rev=290712&view=rev
Log:
[TBAAVerifier] Make things const-consistent; NFC
Modified:
llvm/trunk/include/llvm/IR/Verifier.h
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/include/llvm/IR/Verifier.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Verifier.h?rev=290712&r1=290711&r2=290712&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Verifier.h (original)
+++ llvm/trunk/include/llvm/IR/Verifier.h Thu Dec 29 09:47:01 2016
@@ -48,7 +48,7 @@ class TBAAVerifier {
///
/// \c BitWidth has no meaning if \c IsInvalid is true.
typedef std::pair<bool, unsigned> TBAABaseNodeSummary;
- DenseMap<MDNode *, TBAABaseNodeSummary> TBAABaseNodes;
+ DenseMap<const MDNode *, TBAABaseNodeSummary> TBAABaseNodes;
/// Maps an alleged scalar TBAA node to a boolean that is true if the said
/// TBAA node is a valid scalar TBAA node or false otherwise.
@@ -56,11 +56,12 @@ class TBAAVerifier {
/// \name Helper functions used by \c visitTBAAMetadata.
/// @{
- MDNode *getFieldNodeFromTBAABaseNode(Instruction &I, MDNode *BaseNode,
+ MDNode *getFieldNodeFromTBAABaseNode(Instruction &I, const MDNode *BaseNode,
APInt &Offset);
TBAAVerifier::TBAABaseNodeSummary verifyTBAABaseNode(Instruction &I,
- MDNode *BaseNode);
- TBAABaseNodeSummary verifyTBAABaseNodeImpl(Instruction &I, MDNode *BaseNode);
+ const MDNode *BaseNode);
+ TBAABaseNodeSummary verifyTBAABaseNodeImpl(Instruction &I,
+ const MDNode *BaseNode);
bool isValidScalarTBAANode(const MDNode *MD);
/// @}
@@ -70,7 +71,7 @@ public:
: Diagnostic(Diagnostic) {}
/// Visit an instruction and return true if it is valid, return false if an
/// invalid TBAA is attached.
- bool visitTBAAMetadata(Instruction &I, MDNode *MD);
+ bool visitTBAAMetadata(Instruction &I, const MDNode *MD);
};
/// \brief Check a function for errors, useful for use when debugging a
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=290712&r1=290711&r2=290712&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Thu Dec 29 09:47:01 2016
@@ -4533,7 +4533,7 @@ template <typename... Tys> void TBAAVeri
/// 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, MDNode *BaseNode) {
+TBAAVerifier::verifyTBAABaseNode(Instruction &I, const MDNode *BaseNode) {
if (BaseNode->getNumOperands() < 2) {
CheckFailed("Base nodes must have at least two operands", &I, BaseNode);
return {true, ~0u};
@@ -4551,7 +4551,7 @@ TBAAVerifier::verifyTBAABaseNode(Instruc
}
TBAAVerifier::TBAABaseNodeSummary
-TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, MDNode *BaseNode) {
+TBAAVerifier::verifyTBAABaseNodeImpl(Instruction &I, const MDNode *BaseNode) {
const TBAAVerifier::TBAABaseNodeSummary InvalidNode = {true, ~0u};
if (BaseNode->getNumOperands() == 2) {
@@ -4674,7 +4674,7 @@ bool TBAAVerifier::isValidScalarTBAANode
///
/// We assume we've okayed \p BaseNode via \c verifyTBAABaseNode.
MDNode *TBAAVerifier::getFieldNodeFromTBAABaseNode(Instruction &I,
- MDNode *BaseNode,
+ const MDNode *BaseNode,
APInt &Offset) {
assert(BaseNode->getNumOperands() >= 2 && "Invalid base node!");
@@ -4708,10 +4708,10 @@ MDNode *TBAAVerifier::getFieldNodeFromTB
return cast<MDNode>(BaseNode->getOperand(BaseNode->getNumOperands() - 2));
}
-bool TBAAVerifier::visitTBAAMetadata(Instruction &I, MDNode *MD) {
+bool TBAAVerifier::visitTBAAMetadata(Instruction &I, const MDNode *MD) {
AssertTBAA(isa<LoadInst>(I) || isa<StoreInst>(I) || isa<CallInst>(I) ||
- isa<VAArgInst>(I) || isa<AtomicRMWInst>(I) ||
- isa<AtomicCmpXchgInst>(I),
+ isa<VAArgInst>(I) || isa<AtomicRMWInst>(I) ||
+ isa<AtomicCmpXchgInst>(I),
"TBAA is only for loads, stores and calls!", &I);
bool IsStructPathTBAA =
More information about the llvm-commits
mailing list