From 28bc9d88260a3e153ead4311c9129e3d3ad07736 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 29 Jul 2009 17:16:17 +0000 Subject: Keep track of named mdnodes in a Module using an ilist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77476 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Module.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/VMCore/Module.cpp') diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 35db8d25b5..c9d599eb95 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -67,6 +67,7 @@ Module::~Module() { FunctionList.clear(); AliasList.clear(); LibraryList.clear(); + NamedMDList.clear(); delete ValSymTab; delete TypeSymTab; } @@ -288,6 +289,13 @@ GlobalAlias *Module::getNamedAlias(const StringRef &Name) const { return dyn_cast_or_null(getNamedValue(Name)); } +/// getNamedMetadata - Return the first named MDNode in the module with the +/// specified name. This method returns null if a MDNode with the specified +/// name is not found. +NamedMDNode *Module::getNamedMetadata(const StringRef &Name) const { + return dyn_cast_or_null(getNamedValue(Name)); +} + //===----------------------------------------------------------------------===// // Methods for easy access to the types in the module. // -- cgit v1.2.3-18-g5258