Parse custom metadata attached with an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83033 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-09-29 00:01:14 +00:00
parent 9ad675893f
commit 0475c9170e
9 changed files with 75 additions and 40 deletions

View File

@@ -305,8 +305,10 @@ public:
//===----------------------------------------------------------------------===//
/// MetadataContext -
/// MetadataContext manages metadata used in a context.
/// MetadataContext handles uniquing and assignment of IDs for custom metadata
/// types. Custom metadata handler names do not contain spaces. And the name
/// must start with an alphabet. The regular expression used to check name
/// is [a-zA-Z$._][a-zA-Z$._0-9]*
class MetadataContext {
public:
typedef std::pair<unsigned, WeakVH> MDPairTy;
@@ -330,6 +332,9 @@ public:
/// is not registered then return 0.
unsigned getMDKind(const char *Name);
/// validName - Return true if Name is a valid custom metadata handler name.
bool validName(const char *Name);
/// getMD - Get the metadata of given kind attached with an Instruction.
/// If the metadata is not found then return 0.
MDNode *getMD(unsigned Kind, const Instruction *Inst);