From: Owen Anderson Date: Thu, 2 Jul 2009 17:12:48 +0000 (+0000) Subject: Add accessor for MDNode. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=77cf22c451c987a1c128e8ea5b9ed9e2d4655eeb;p=oota-llvm.git Add accessor for MDNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74705 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 877995203e9..8afa4a523f0 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& Params, diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index 1987463af30..6e06c55428e 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& Params,