Mercurial > projects > ldc
comparison gen/rttibuilder.cpp @ 1545:7fcb72d518f6
More factory methods moved to LLVMContext
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Wed, 15 Jul 2009 18:09:41 +0200 |
parents | ad7f2f1862d6 |
children | d6e8d5db259f |
comparison
equal
deleted
inserted
replaced
1544:8863cf7236e6 | 1545:7fcb72d518f6 |
---|---|
140 } | 140 } |
141 | 141 |
142 void RTTIBuilder::finalize(IrGlobal* tid) | 142 void RTTIBuilder::finalize(IrGlobal* tid) |
143 { | 143 { |
144 // create the inititalizer | 144 // create the inititalizer |
145 LLConstant* tiInit = llvm::ConstantStruct::get(&inits[0], inits.size(), false); | 145 LLConstant* tiInit = gIR->context().getConstantStruct(&inits[0], inits.size(), false); |
146 | 146 |
147 // refine global type | 147 // refine global type |
148 llvm::cast<llvm::OpaqueType>(tid->type.get())->refineAbstractTypeTo(tiInit->getType()); | 148 llvm::cast<llvm::OpaqueType>(tid->type.get())->refineAbstractTypeTo(tiInit->getType()); |
149 | 149 |
150 // set the initializer | 150 // set the initializer |
152 } | 152 } |
153 | 153 |
154 LLConstant* RTTIBuilder::get_constant() | 154 LLConstant* RTTIBuilder::get_constant() |
155 { | 155 { |
156 // just return the inititalizer | 156 // just return the inititalizer |
157 return llvm::ConstantStruct::get(&inits[0], inits.size(), false); | 157 return gIR->context().getConstantStruct(&inits[0], inits.size(), false); |
158 } | 158 } |