comparison gen/toir.cpp @ 836:14c3319ac1bb

This ''should'' fix #139 , I failed to produce a testcase, but I would imagine this to be correct, and it removes '''that''' error when building Hybrid.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 09 Dec 2008 03:01:19 +0100
parents f466f475b654
children 331a176c1f4f
comparison
equal deleted inserted replaced
835:3afe9f276db7 836:14c3319ac1bb
222 LLConstant* m = DtoTypeInfoOf(ti->tinfo, false); 222 LLConstant* m = DtoTypeInfoOf(ti->tinfo, false);
223 if (m->getType() != getPtrToType(vartype)) 223 if (m->getType() != getPtrToType(vartype))
224 m = llvm::ConstantExpr::getBitCast(m, vartype); 224 m = llvm::ConstantExpr::getBitCast(m, vartype);
225 return m; 225 return m;
226 } 226 }
227 else if (VarDeclaration* vd = var->isVarDeclaration())
228 {
229 // return the initializer
230 assert(vd->init);
231 return DtoConstInitializer(loc, type, vd->init);
232 }
233 // fail
227 assert(0 && "Unsupported const VarExp kind"); 234 assert(0 && "Unsupported const VarExp kind");
228 return NULL; 235 return NULL;
229 } 236 }
230 237
231 ////////////////////////////////////////////////////////////////////////////////////////// 238 //////////////////////////////////////////////////////////////////////////////////////////