IR: Initialize MDNode abbreviations en masse, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 4 Feb 2015 21:54:12 +0000 (21:54 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 4 Feb 2015 21:54:12 +0000 (21:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228203 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp

index 5b502bce2bcca60216534d4a1c87422c7f0b71cc..6f8c26069a67b1c2a6c215733b5231d571f2ecf0 100644 (file)
@@ -828,7 +828,10 @@ static void WriteModuleMetadata(const Module *M,
     MDSAbbrev = Stream.EmitAbbrev(Abbv);
   }
 
-  unsigned MDLocationAbbrev = 0;
+  // Initialize MDNode abbreviations.
+#define HANDLE_MDNODE_LEAF(CLASS) unsigned CLASS##Abbrev = 0;
+#include "llvm/IR/Metadata.def"
+
   if (VE.hasMDLocation()) {
     // Abbrev for METADATA_LOCATION.
     //
@@ -844,7 +847,6 @@ static void WriteModuleMetadata(const Module *M,
     MDLocationAbbrev = Stream.EmitAbbrev(Abbv);
   }
 
-  unsigned GenericDebugNodeAbbrev = 0;
   if (VE.hasGenericDebugNode()) {
     // Abbrev for METADATA_GENERIC_DEBUG.
     //
@@ -871,7 +873,6 @@ static void WriteModuleMetadata(const Module *M,
     NameAbbrev = Stream.EmitAbbrev(Abbv);
   }
 
-  unsigned MDTupleAbbrev = 0;
   SmallVector<uint64_t, 64> Record;
   for (const Metadata *MD : MDs) {
     if (const MDNode *N = dyn_cast<MDNode>(MD)) {