Add accessor for MDNode.

llvm-svn: 74705
This commit is contained in:
Owen Anderson 2009-07-02 17:12:48 +00:00
parent bd328c24a0
commit 39d4fb4bc0
2 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,7 @@ class ConstantArray;
class ConstantFP; class ConstantFP;
class ConstantVector; class ConstantVector;
class UndefValue; class UndefValue;
class MDNode;
class IntegerType; class IntegerType;
class PointerType; class PointerType;
class StructType; class StructType;
@ -176,6 +177,9 @@ public:
Constant* getConstantVector(Constant* const* Vals, unsigned NumVals); Constant* getConstantVector(Constant* const* Vals, unsigned NumVals);
ConstantVector* getConstantVectorAllOnes(const VectorType* Ty); ConstantVector* getConstantVectorAllOnes(const VectorType* Ty);
// MDNode accessors
MDNode* getMDNode(Value* const* Vals, unsigned NumVals);
// FunctionType accessors // FunctionType accessors
FunctionType* getFunctionType(const Type* Result, FunctionType* getFunctionType(const Type* Result,
const std::vector<const Type*>& Params, const std::vector<const Type*>& Params,

View File

@ -15,6 +15,7 @@
#include "llvm/LLVMContext.h" #include "llvm/LLVMContext.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/MDNode.h"
#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/ManagedStatic.h"
#include "LLVMContextImpl.h" #include "LLVMContextImpl.h"
@ -405,6 +406,11 @@ ConstantVector* LLVMContext::getConstantVectorAllOnes(const VectorType* Ty) {
return ConstantVector::getAllOnesValue(Ty); return ConstantVector::getAllOnesValue(Ty);
} }
// MDNode accessors
MDNode* LLVMContext::getMDNode(Value* const* Vals, unsigned NumVals) {
return MDNode::get(Vals, NumVals);
}
// FunctionType accessors // FunctionType accessors
FunctionType* LLVMContext::getFunctionType(const Type* Result, FunctionType* LLVMContext::getFunctionType(const Type* Result,
const std::vector<const Type*>& Params, const std::vector<const Type*>& Params,