IR: Take an LLVMContext in Metadata::Metadata()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222019 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-14 18:42:09 +00:00
parent 24593ac779
commit e9b30c72ad
2 changed files with 5 additions and 2 deletions

View File

@ -41,7 +41,7 @@ enum LLVMConstants : uint32_t {
/// TODO: Detach from the Value hierarchy.
class Metadata : public Value {
protected:
Metadata(Type *Type, unsigned ID) : Value(Type, ID) {}
Metadata(LLVMContext &Context, unsigned ID);
public:
static bool classof(const Value *V) {

View File

@ -28,6 +28,9 @@
using namespace llvm;
Metadata::Metadata(LLVMContext &Context, unsigned ID)
: Value(Type::getMetadataTy(Context), ID) {}
//===----------------------------------------------------------------------===//
// MDString implementation.
//
@ -119,7 +122,7 @@ void MDNode::replaceOperandWith(unsigned i, Value *Val) {
}
MDNode::MDNode(LLVMContext &C, ArrayRef<Value *> Vals, bool isFunctionLocal)
: Metadata(Type::getMetadataTy(C), Value::MDNodeVal) {
: Metadata(C, Value::MDNodeVal) {
NumOperands = Vals.size();
if (isFunctionLocal)