Add ArrayRef variant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2011-03-04 01:20:33 +00:00
parent 40a42a2cca
commit 566bd12e54
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#define LLVM_METADATA_H
#include "llvm/Value.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/ilist_node.h"
@ -117,6 +118,8 @@ class MDNode : public Value, public FoldingSetNode {
FunctionLocalness FL, bool Insert = true);
public:
// Constructors and destructors.
static MDNode *get(LLVMContext &Context, ArrayRef<Value*> V);
// FIXME: Eliminate this constructor form.
static MDNode *get(LLVMContext &Context, Value *const *Vals,
unsigned NumVals);
// getWhenValsUnresolved - Construct MDNode determining function-localness

View File

@ -232,6 +232,9 @@ MDNode *MDNode::getMDNode(LLVMContext &Context, Value *const *Vals,
return N;
}
MDNode *MDNode::get(LLVMContext &Context, ArrayRef<Value*> Vals) {
return getMDNode(Context, Vals.data(), Vals.size(), FL_Unknown);
}
MDNode *MDNode::get(LLVMContext &Context, Value*const* Vals, unsigned NumVals) {
return getMDNode(Context, Vals, NumVals, FL_Unknown);
}