Mercurial > projects > ldc
comparison gen/tollvm.c @ 78:2332006e1fa4 trunk
[svn r82] Fixed: Fall-through switch cases were broken.
author | lindquist |
---|---|
date | Wed, 31 Oct 2007 20:50:21 +0100 |
parents | 714057ff2dbb |
children | 3587401b6eeb |
comparison
equal
deleted
inserted
replaced
77:714057ff2dbb | 78:2332006e1fa4 |
---|---|
1239 new llvm::StoreInst(retval, arg->mem, gIR->scopebb()); | 1239 new llvm::StoreInst(retval, arg->mem, gIR->scopebb()); |
1240 retval = arg->mem; | 1240 retval = arg->mem; |
1241 } | 1241 } |
1242 } | 1242 } |
1243 | 1243 |
1244 if (fnarg && paramtype && retval->getType() != paramtype) { | |
1245 // this is unfortunately needed with the way SymOffExp is overused | |
1246 // and static arrays can end up being a pointer to their element type | |
1247 if (arg->field) { | |
1248 retval = gIR->ir->CreateBitCast(retval, paramtype, "tmp"); | |
1249 } | |
1250 else { | |
1251 Logger::cout() << "got '" << *retval->getType() << "' expected '" << *paramtype << "'\n"; | |
1252 assert(0 && "parameter type that was actually passed is invalid"); | |
1253 } | |
1254 } | |
1255 | |
1244 delete arg; | 1256 delete arg; |
1245 | 1257 |
1246 if (fnarg && paramtype && retval->getType() != paramtype) { | |
1247 Logger::cout() << "got '" << *retval->getType() << "' expected '" << *paramtype << "'\n"; | |
1248 assert(0 && "parameter type that was actually passed is invalid"); | |
1249 } | |
1250 return retval; | 1258 return retval; |
1251 } | 1259 } |
1252 | 1260 |
1253 ////////////////////////////////////////////////////////////////////////////////////////// | 1261 ////////////////////////////////////////////////////////////////////////////////////////// |
1254 | 1262 |