Mercurial > projects > ldc
comparison ir/irstruct.cpp @ 1569:755abafbf25d
Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 06 Aug 2009 01:47:39 +0200 |
parents | 1d5c3354b3c2 |
children | 8d086d552909 |
comparison
equal
deleted
inserted
replaced
1568:a591aa6bd6dc | 1569:755abafbf25d |
---|---|
193 { | 193 { |
194 add_zeros(constants, aggrdecl->structsize - offset); | 194 add_zeros(constants, aggrdecl->structsize - offset); |
195 } | 195 } |
196 | 196 |
197 // build constant struct | 197 // build constant struct |
198 llvm::Constant* definit = LLConstantStruct::get(constants, packed); | 198 llvm::Constant* definit = LLConstantStruct::get(gIR->context(), constants, packed); |
199 #if 0 | 199 #if 0 |
200 IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl; | 200 IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl; |
201 #endif | 201 #endif |
202 | 202 |
203 return definit; | 203 return definit; |
382 add_zeros(constants, diff); | 382 add_zeros(constants, diff); |
383 } | 383 } |
384 | 384 |
385 // build constant | 385 // build constant |
386 assert(!constants.empty()); | 386 assert(!constants.empty()); |
387 llvm::Constant* c = LLConstantStruct::get(&constants[0], constants.size(), packed); | 387 llvm::Constant* c = LLConstantStruct::get(gIR->context(), &constants[0], constants.size(), packed); |
388 IF_LOG Logger::cout() << "final struct initializer: " << *c << std::endl; | 388 IF_LOG Logger::cout() << "final struct initializer: " << *c << std::endl; |
389 return c; | 389 return c; |
390 } | 390 } |