comparison gen/tollvm.cpp @ 237:a168a2c3ea48 trunk

[svn r253] Removed -inlineasm option. inline asm is now enabled by default unless the new -noasm option is passed. Tried adding a stack trace print when compiler crashes, not sure it's working though. Changed data layouts to match that of llvm-gcc. Fixed casting function pointers. Added support checks in AsmStatement.
author lindquist
date Sun, 08 Jun 2008 19:09:24 +0200
parents 0806379a5eca
children a95056b3c996
comparison
equal deleted inserted replaced
236:df1abfe27be6 237:a168a2c3ea48
1115 { 1115 {
1116 const LLType* tolltype = DtoType(to); 1116 const LLType* tolltype = DtoType(to);
1117 1117
1118 Type* totype = DtoDType(to); 1118 Type* totype = DtoDType(to);
1119 Type* fromtype = DtoDType(val->getType()); 1119 Type* fromtype = DtoDType(val->getType());
1120 assert(fromtype->ty == Tpointer); 1120 assert(fromtype->ty == Tpointer || fromtype->ty == Tfunction);
1121 1121
1122 LLValue* rval; 1122 LLValue* rval;
1123 1123
1124 if (totype->ty == Tpointer || totype->ty == Tclass) { 1124 if (totype->ty == Tpointer || totype->ty == Tclass) {
1125 LLValue* src = val->getRVal(); 1125 LLValue* src = val->getRVal();
1254 return DtoCastClass(val, to); 1254 return DtoCastClass(val, to);
1255 } 1255 }
1256 else if (fromtype->ty == Tarray || fromtype->ty == Tsarray) { 1256 else if (fromtype->ty == Tarray || fromtype->ty == Tsarray) {
1257 return DtoCastArray(val, to); 1257 return DtoCastArray(val, to);
1258 } 1258 }
1259 else if (fromtype->ty == Tpointer) { 1259 else if (fromtype->ty == Tpointer || fromtype->ty == Tfunction) {
1260 return DtoCastPtr(val, to); 1260 return DtoCastPtr(val, to);
1261 } 1261 }
1262 else { 1262 else {
1263 assert(0); 1263 assert(0);
1264 } 1264 }