aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-29 20:42:25 +0000
committerDevang Patel <dpatel@apple.com>2009-09-29 20:42:25 +0000
commit91291d92510d559e84bb36184703684dcd330469 (patch)
treee23d104d7b7461096f0600f642441f00848f9d1c /include/llvm
parent3402a11ab9fadebbfd897d532e3dd3ec33bc76d5 (diff)
downloadexternal_llvm-91291d92510d559e84bb36184703684dcd330469.zip
external_llvm-91291d92510d559e84bb36184703684dcd330469.tar.gz
external_llvm-91291d92510d559e84bb36184703684dcd330469.tar.bz2
Add removeMD().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Metadata.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 8ad7aaf..e441481 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -345,6 +345,12 @@ public:
/// addMD - Attach the metadata of given kind with an Instruction.
void addMD(unsigned Kind, MDNode *Node, Instruction *Inst);
+ /// removeMD - Remove metadata of given kind attached with an instuction.
+ void removeMD(unsigned Kind, Instruction *Inst);
+
+ /// removeMDs - Remove all metadata attached with an instruction.
+ void removeMDs(const Instruction *Inst);
+
/// getHandlerNames - Get handler names. This is used by bitcode
/// writer.
const StringMap<unsigned> *getHandlerNames();
@@ -352,7 +358,9 @@ public:
/// ValueIsDeleted - This handler is used to update metadata store
/// when a value is deleted.
void ValueIsDeleted(const Value *V) {}
- void ValueIsDeleted(const Instruction *Inst);
+ void ValueIsDeleted(const Instruction *Inst) {
+ removeMDs(Inst);
+ }
/// ValueIsCloned - This handler is used to update metadata store
/// when In1 is cloned to create In2.