diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-02 17:12:48 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-02 17:12:48 +0000 |
commit | c43f257d1e5020f92e31dd99d03820ad69ae63bf (patch) | |
tree | b25947450370050d34199f7a34aa5ca39a109b5e | |
parent | 04cbeecefa39842809cf704d380b71386120039e (diff) | |
download | external_llvm-c43f257d1e5020f92e31dd99d03820ad69ae63bf.zip external_llvm-c43f257d1e5020f92e31dd99d03820ad69ae63bf.tar.gz external_llvm-c43f257d1e5020f92e31dd99d03820ad69ae63bf.tar.bz2 |
Add accessor for MDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74705 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/LLVMContext.h | 4 | ||||
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 8779952..8afa4a5 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -31,6 +31,7 @@ class ConstantArray; class ConstantFP; class ConstantVector; class UndefValue; +class MDNode; class IntegerType; class PointerType; class StructType; @@ -176,6 +177,9 @@ public: Constant* getConstantVector(Constant* const* Vals, unsigned NumVals); ConstantVector* getConstantVectorAllOnes(const VectorType* Ty); + // MDNode accessors + MDNode* getMDNode(Value* const* Vals, unsigned NumVals); + // FunctionType accessors FunctionType* getFunctionType(const Type* Result, const std::vector<const Type*>& Params, diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index 1987463..6e06c55 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -15,6 +15,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/MDNode.h" #include "llvm/Support/ManagedStatic.h" #include "LLVMContextImpl.h" @@ -405,6 +406,11 @@ ConstantVector* LLVMContext::getConstantVectorAllOnes(const VectorType* Ty) { return ConstantVector::getAllOnesValue(Ty); } +// MDNode accessors +MDNode* LLVMContext::getMDNode(Value* const* Vals, unsigned NumVals) { + return MDNode::get(Vals, NumVals); +} + // FunctionType accessors FunctionType* LLVMContext::getFunctionType(const Type* Result, const std::vector<const Type*>& Params, |