Add accessor for MDNode.
authorOwen Anderson <resistor@mac.com>
Thu, 2 Jul 2009 17:12:48 +0000 (17:12 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 2 Jul 2009 17:12:48 +0000 (17:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74705 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/LLVMContext.h
lib/VMCore/LLVMContext.cpp

index 877995203e912a991149ef006aeebe7d066cdbd8..8afa4a523f0b4f4929d8474f649d4825beb78513 100644 (file)
@@ -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,
index 1987463af301f7f3ebfcaf6a9c6282b66882bb6b..6e06c55428ec1711fb1deb3ff904149ac224610d 100644 (file)
@@ -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,