Mercurial > projects > ldc
comparison ir/irclass.cpp @ 1571:8d086d552909
IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Fri, 14 Aug 2009 00:39:18 +0200 |
parents | 755abafbf25d |
children | 40bd4a0d4870 |
comparison
equal
deleted
inserted
replaced
1570:ab03cfb3a212 | 1571:8d086d552909 |
---|---|
81 bool hasDestructor = (classdecl->dtor != NULL); | 81 bool hasDestructor = (classdecl->dtor != NULL); |
82 bool hasCustomDelete = (classdecl->aggDelete != NULL); | 82 bool hasCustomDelete = (classdecl->aggDelete != NULL); |
83 // Construct the fields | 83 // Construct the fields |
84 MDNodeField* mdVals[CD_NumFields]; | 84 MDNodeField* mdVals[CD_NumFields]; |
85 mdVals[CD_BodyType] = llvm::UndefValue::get(bodyType); | 85 mdVals[CD_BodyType] = llvm::UndefValue::get(bodyType); |
86 mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor); | 86 mdVals[CD_Finalize] = LLConstantInt::get(LLType::getInt1Ty(gIR->context()), hasDestructor); |
87 mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete); | 87 mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::getInt1Ty(gIR->context()), hasCustomDelete); |
88 // Construct the metadata | 88 // Construct the metadata |
89 llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, CD_NumFields); | 89 llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, CD_NumFields); |
90 // Insert it into the module | 90 // Insert it into the module |
91 std::string metaname = CD_PREFIX + initname; | 91 std::string metaname = CD_PREFIX + initname; |
92 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module); | 92 llvm::NamedMDNode::Create(gIR->context(), metaname, &metadata, 1, gIR->module); |
93 } | 93 } |
94 #endif // USE_METADATA | 94 #endif // USE_METADATA |
95 | 95 |
96 return classInfo; | 96 return classInfo; |
97 } | 97 } |