comparison gen/llvmhelpers.h @ 399:0e6b4d65d3f8

Give error messages for invalid casts. This required passing Loc information to certain functions. Fixes nocompile/b/bug_cgcs_354_A/B.
author Christian Kamm <kamm incasoftware de>
date Sat, 26 Jul 2008 17:19:16 +0200
parents 83ade4f4025a
children ac1fcc138e42
comparison
equal deleted inserted replaced
398:811f82dfddbd 399:0e6b4d65d3f8
37 // nested variable/class helpers 37 // nested variable/class helpers
38 LLValue* DtoNestedContext(FuncDeclaration* func); 38 LLValue* DtoNestedContext(FuncDeclaration* func);
39 LLValue* DtoNestedVariable(VarDeclaration* vd); 39 LLValue* DtoNestedVariable(VarDeclaration* vd);
40 40
41 // basic operations 41 // basic operations
42 void DtoAssign(DValue* lhs, DValue* rhs); 42 void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs);
43 43
44 // create a null dvalue 44 // create a null dvalue
45 DValue* DtoNullValue(Type* t); 45 DValue* DtoNullValue(Type* t);
46 46
47 // casts 47 // casts
48 DValue* DtoCastInt(DValue* val, Type* to); 48 DValue* DtoCastInt(Loc& loc, DValue* val, Type* to);
49 DValue* DtoCastPtr(DValue* val, Type* to); 49 DValue* DtoCastPtr(Loc& loc, DValue* val, Type* to);
50 DValue* DtoCastFloat(DValue* val, Type* to); 50 DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to);
51 DValue* DtoCast(DValue* val, Type* to); 51 DValue* DtoCast(Loc& loc, DValue* val, Type* to);
52 52
53 // is template instance check 53 // is template instance check
54 bool DtoIsTemplateInstance(Dsymbol* s); 54 bool DtoIsTemplateInstance(Dsymbol* s);
55 55
56 // generates lazy static initialization code for a global variable 56 // generates lazy static initialization code for a global variable
100 * @return The function call's return value. 100 * @return The function call's return value.
101 */ 101 */
102 DValue* DtoCallDFunc(FuncDeclaration* fdecl, Array* arguments, TypeClass* type=0, LLValue* thismem=0); 102 DValue* DtoCallDFunc(FuncDeclaration* fdecl, Array* arguments, TypeClass* type=0, LLValue* thismem=0);
103 103
104 /// Converts any value to a boolean (llvm i1) 104 /// Converts any value to a boolean (llvm i1)
105 LLValue* DtoBoolean(DValue* dval); 105 LLValue* DtoBoolean(Loc& loc, DValue* dval);
106 106
107 #endif 107 #endif