I noticed that named metadata doesn't provide a direct way of getting at the
authorDuncan Sands <baldrick@free.fr>
Wed, 16 May 2012 12:25:43 +0000 (12:25 +0000)
committerDuncan Sands <baldrick@free.fr>
Wed, 16 May 2012 12:25:43 +0000 (12:25 +0000)
named metadata list, unlike all the other global objects (global variables,
functions, aliases), so add that for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156915 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Module.h

index 570b1bc7b450416b20fd7b22c0f3f8593546e4ce..cb7c1dc36a627e4d8ced3cc917a6aeb33e6c6b27 100644 (file)
@@ -498,6 +498,13 @@ public:
   static iplist<GlobalAlias> Module::*getSublistAccess(GlobalAlias*) {
     return &Module::AliasList;
   }
+  /// Get the Module's list of named metadata (constant).
+  const NamedMDListType  &getNamedMDList() const      { return NamedMDList; }
+  /// Get the Module's list of named metadata.
+  NamedMDListType        &getNamedMDList()            { return NamedMDList; }
+  static ilist<NamedMDNode> Module::*getSublistAccess(NamedMDNode*) {
+    return &Module::NamedMDList;
+  }
   /// Get the symbol table of global variable and function identifiers
   const ValueSymbolTable &getValueSymbolTable() const { return *ValSymTab; }
   /// Get the Module's symbol table of global variable and function identifiers.