[llvm] r228609 - Verifier: Const-qualify Metadata, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Feb 9 13:30:05 PST 2015
Author: dexonsmith
Date: Mon Feb 9 15:30:05 2015
New Revision: 228609
URL: http://llvm.org/viewvc/llvm-project?rev=228609&view=rev
Log:
Verifier: Const-qualify Metadata, NFC
Modified:
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=228609&r1=228608&r2=228609&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Mon Feb 9 15:30:05 2015
@@ -191,7 +191,7 @@ class Verifier : public InstVisitor<Veri
SmallPtrSet<Instruction *, 16> InstsInThisBlock;
/// \brief Keep track of the metadata nodes that have been checked already.
- SmallPtrSet<Metadata *, 32> MDNodes;
+ SmallPtrSet<const Metadata *, 32> MDNodes;
/// \brief The personality function referenced by the LandingPadInsts.
/// All LandingPadInsts within the same function must use the same
@@ -290,9 +290,9 @@ private:
void visitAliaseeSubExpr(SmallPtrSetImpl<const GlobalAlias *> &Visited,
const GlobalAlias &A, const Constant &C);
void visitNamedMDNode(const NamedMDNode &NMD);
- void visitMDNode(MDNode &MD);
- void visitMetadataAsValue(MetadataAsValue &MD, Function *F);
- void visitValueAsMetadata(ValueAsMetadata &MD, Function *F);
+ void visitMDNode(const MDNode &MD);
+ void visitMetadataAsValue(const MetadataAsValue &MD, Function *F);
+ void visitValueAsMetadata(const ValueAsMetadata &MD, Function *F);
void visitComdat(const Comdat &C);
void visitModuleIdents(const Module &M);
void visitModuleFlags(const Module &M);
@@ -595,7 +595,7 @@ void Verifier::visitNamedMDNode(const Na
}
}
-void Verifier::visitMDNode(MDNode &MD) {
+void Verifier::visitMDNode(const MDNode &MD) {
// Only visit each node once. Metadata can be mutually recursive, so this
// avoids infinite recursion here, as well as being an optimization.
if (!MDNodes.insert(&MD).second)
@@ -622,7 +622,7 @@ void Verifier::visitMDNode(MDNode &MD) {
Assert1(MD.isResolved(), "All nodes should be resolved!", &MD);
}
-void Verifier::visitValueAsMetadata(ValueAsMetadata &MD, Function *F) {
+void Verifier::visitValueAsMetadata(const ValueAsMetadata &MD, Function *F) {
Assert1(MD.getValue(), "Expected valid value", &MD);
Assert2(!MD.getValue()->getType()->isMetadataTy(),
"Unexpected metadata round-trip through values", &MD, MD.getValue());
@@ -648,7 +648,7 @@ void Verifier::visitValueAsMetadata(Valu
Assert1(ActualF == F, "function-local metadata used in wrong function", L);
}
-void Verifier::visitMetadataAsValue(MetadataAsValue &MDV, Function *F) {
+void Verifier::visitMetadataAsValue(const MetadataAsValue &MDV, Function *F) {
Metadata *MD = MDV.getMetadata();
if (auto *N = dyn_cast<MDNode>(MD)) {
visitMDNode(*N);
More information about the llvm-commits
mailing list