aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-29 00:01:14 +0000
committerDevang Patel <dpatel@apple.com>2009-09-29 00:01:14 +0000
commit0475c9170e9621292a48c688c3976031be5650bb (patch)
tree27fa176e397a7b67a917a5fe229c48e86bf41bdd /include/llvm/Metadata.h
parent9ad675893f8357add0015531dc53892bb017e54b (diff)
downloadexternal_llvm-0475c9170e9621292a48c688c3976031be5650bb.zip
external_llvm-0475c9170e9621292a48c688c3976031be5650bb.tar.gz
external_llvm-0475c9170e9621292a48c688c3976031be5650bb.tar.bz2
Parse custom metadata attached with an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 883de23..2f740a6 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -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);