summaryrefslogtreecommitdiff
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-20 22:02:26 +0000
committerDan Gohman <gohman@apple.com>2010-08-20 22:02:26 +0000
commit489b29b0a4ee4526e3d50ad88d3d48745baf5042 (patch)
tree6602f14da364b9d6e0714e7b327adf14d7ffac23 /include/llvm/Metadata.h
parent95c79302259c03aa99010bbbc7d8ffeae3fa9740 (diff)
downloadllvm-489b29b0a4ee4526e3d50ad88d3d48745baf5042.tar.gz
llvm-489b29b0a4ee4526e3d50ad88d3d48745baf5042.tar.bz2
llvm-489b29b0a4ee4526e3d50ad88d3d48745baf5042.tar.xz
Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd. This replaces a variety of alternate mechanisms for achieving the same effect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index ef9646e977..f773817e82 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -128,6 +128,16 @@ public:
static MDNode *getIfExists(LLVMContext &Context, Value *const *Vals,
unsigned NumVals);
+
+ /// getTemporary - Return a temporary MDNode, for use in constructing
+ /// cyclic MDNode structures. A temporary MDNode is not uniqued,
+ /// may be RAUW'd, and must be manually deleted with deleteTemporary.
+ static MDNode *getTemporary(LLVMContext &Context, Value *const *Vals,
+ unsigned NumVals);
+
+ /// deleteTemporary - Deallocate a node created by getTemporary. The
+ /// node must not have any users.
+ static void deleteTemporary(MDNode *N);
/// getOperand - Return specified operand.
Value *getOperand(unsigned i) const;