diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-20 22:02:26 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-20 22:02:26 +0000 |
| commit | ddaa8088b0f138ccc184b3f2fd84e074862418f5 (patch) | |
| tree | 6602f14da364b9d6e0714e7b327adf14d7ffac23 /include/llvm/Metadata.h | |
| parent | 8c7bd3dda0870cbc9daa5cd58c3070e2eb29856a (diff) | |
| download | external_llvm-ddaa8088b0f138ccc184b3f2fd84e074862418f5.zip external_llvm-ddaa8088b0f138ccc184b3f2fd84e074862418f5.tar.gz external_llvm-ddaa8088b0f138ccc184b3f2fd84e074862418f5.tar.bz2 | |
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.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index ef9646e..f773817 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; |
