summaryrefslogtreecommitdiff
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2010-01-26 02:36:35 +0000
committerVictor Hernandez <vhernandez@apple.com>2010-01-26 02:36:35 +0000
commite685f230b6f4f7cd65f45e07cbbbcaa4d66a1cea (patch)
treecbe67fcbd32f46166f0451510adf65f37b2cd1ce /include/llvm/Metadata.h
parent4cf292a86d059789328879216a7f41f5504a033c (diff)
downloadllvm-e685f230b6f4f7cd65f45e07cbbbcaa4d66a1cea.tar.gz
llvm-e685f230b6f4f7cd65f45e07cbbbcaa4d66a1cea.tar.bz2
llvm-e685f230b6f4f7cd65f45e07cbbbcaa4d66a1cea.tar.xz
Add MDNode::getIfExists(), an efficient way to determine if a value is used by metadata (since metadata does not appear in a value's use list)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index f1e7a22a42..4e459bf7bf 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -112,7 +112,7 @@ protected:
bool isFunctionLocal);
static MDNode *getMDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
- FunctionLocalness FL);
+ FunctionLocalness FL, bool Insert = true);
public:
// Constructors and destructors.
static MDNode *get(LLVMContext &Context, Value *const *Vals,
@@ -121,6 +121,9 @@ public:
// from isFunctionLocal argument, not by analyzing Vals.
static MDNode *getWhenValsUnresolved(LLVMContext &Context, Value *const *Vals,
unsigned NumVals, bool isFunctionLocal);
+
+ static MDNode *getIfExists(LLVMContext &Context, Value *const *Vals,
+ unsigned NumVals);
/// getOperand - Return specified operand.
Value *getOperand(unsigned i) const;