diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:45:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:45:51 +0000 |
commit | 0eb419800ae51d6e0e00a656ede0627483755361 (patch) | |
tree | 11dc009d755eda2b02147fc4be338d0912bce39c /include/llvm/Metadata.h | |
parent | 7d05c46d601cbb52be605019548c34286c02e3a3 (diff) | |
download | llvm-0eb419800ae51d6e0e00a656ede0627483755361.tar.gz llvm-0eb419800ae51d6e0e00a656ede0627483755361.tar.bz2 llvm-0eb419800ae51d6e0e00a656ede0627483755361.tar.xz |
rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r-- | include/llvm/Metadata.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index 10433df7d9..a6e2d812e3 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -197,32 +197,25 @@ public: }; //===----------------------------------------------------------------------===// -/// MetadataContext - -/// 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]* +/// MetadataContext - MetadataContext handles uniquing and assignment of IDs for +/// custom metadata types. +/// class MetadataContext { - // DO NOT IMPLEMENT - MetadataContext(MetadataContext&); - void operator=(MetadataContext&); + MetadataContext(MetadataContext&); // DO NOT IMPLEMENT + void operator=(MetadataContext&); // DO NOT IMPLEMENT MetadataContextImpl *const pImpl; public: MetadataContext(); ~MetadataContext(); - /// registerMDKind - Register a new metadata kind and return its ID. - /// A metadata kind can be registered only once. - unsigned registerMDKind(StringRef Name); - - /// getMDKind - Return metadata kind. If the requested metadata kind - /// is not registered then return 0. - unsigned getMDKind(StringRef Name) const; + /// getMDKindID - Return a unique non-zero ID for the specified metadata kind. + unsigned getMDKindID(StringRef Name) const; /// isValidName - Return true if Name is a valid custom metadata handler name. static bool isValidName(StringRef Name); +#if 1 /// getMD - Get the metadata of given kind attached to an Instruction. /// If the metadata is not found then return 0. MDNode *getMD(unsigned Kind, const Instruction *Inst); @@ -239,6 +232,7 @@ public: /// removeAllMetadata - Remove all metadata attached with an instruction. void removeAllMetadata(Instruction *Inst); +#endif /// copyMD - If metadata is attached with Instruction In1 then attach /// the same metadata to In2. |