[llvm] r228645 - Verifier: Create stubs for specialized metadata nodes

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Feb 9 17:09:50 PST 2015


Author: dexonsmith
Date: Mon Feb  9 19:09:50 2015
New Revision: 228645

URL: http://llvm.org/viewvc/llvm-project?rev=228645&view=rev
Log:
Verifier: Create stubs for specialized metadata nodes

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=228645&r1=228644&r2=228645&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Mon Feb  9 19:09:50 2015
@@ -303,6 +303,8 @@ private:
   void visitBasicBlock(BasicBlock &BB);
   void visitRangeMetadata(Instruction& I, MDNode* Range, Type* Ty);
 
+#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) void visit##CLASS(const CLASS &N);
+#include "llvm/IR/Metadata.def"
 
   // InstVisitor overrides...
   using InstVisitor<Verifier>::visit;
@@ -601,6 +603,18 @@ void Verifier::visitMDNode(const MDNode
   if (!MDNodes.insert(&MD).second)
     return;
 
+  switch (MD.getMetadataID()) {
+  default:
+    llvm_unreachable("Invalid MDNode subclass");
+  case Metadata::MDTupleKind:
+    break;
+#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS)                                  \
+  case Metadata::CLASS##Kind:                                                  \
+    visit##CLASS(cast<CLASS>(MD));                                             \
+    break;
+#include "llvm/IR/Metadata.def"
+  }
+
   for (unsigned i = 0, e = MD.getNumOperands(); i != e; ++i) {
     Metadata *Op = MD.getOperand(i);
     if (!Op)
@@ -664,6 +678,29 @@ void Verifier::visitMetadataAsValue(cons
     visitValueAsMetadata(*V, F);
 }
 
+void Verifier::visitMDLocation(const MDLocation &) {}
+void Verifier::visitGenericDebugNode(const GenericDebugNode &) {}
+void Verifier::visitMDSubrange(const MDSubrange &) {}
+void Verifier::visitMDEnumerator(const MDEnumerator &) {}
+void Verifier::visitMDBasicType(const MDBasicType &) {}
+void Verifier::visitMDDerivedType(const MDDerivedType &) {}
+void Verifier::visitMDCompositeType(const MDCompositeType &) {}
+void Verifier::visitMDSubroutineType(const MDSubroutineType &) {}
+void Verifier::visitMDFile(const MDFile &) {}
+void Verifier::visitMDCompileUnit(const MDCompileUnit &) {}
+void Verifier::visitMDSubprogram(const MDSubprogram &) {}
+void Verifier::visitMDLexicalBlock(const MDLexicalBlock &) {}
+void Verifier::visitMDLexicalBlockFile(const MDLexicalBlockFile &) {}
+void Verifier::visitMDNamespace(const MDNamespace &) {}
+void Verifier::visitMDTemplateTypeParameter(const MDTemplateTypeParameter &) {}
+void Verifier::visitMDTemplateValueParameter(const MDTemplateValueParameter &) {
+}
+void Verifier::visitMDGlobalVariable(const MDGlobalVariable &) {}
+void Verifier::visitMDLocalVariable(const MDLocalVariable &) {}
+void Verifier::visitMDExpression(const MDExpression &) {}
+void Verifier::visitMDObjCProperty(const MDObjCProperty &) {}
+void Verifier::visitMDImportedEntity(const MDImportedEntity &) {}
+
 void Verifier::visitComdat(const Comdat &C) {
   // All Comdat::SelectionKind values other than Comdat::Any require a
   // GlobalValue with the same name as the Comdat.





More information about the llvm-commits mailing list