Mercurial > projects > ldc
diff gen/aa.cpp @ 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 | a9697749e898 |
children | d3d3519b72e8 |
line wrap: on
line diff
--- a/gen/aa.cpp Sat Jul 26 15:42:05 2008 +0200 +++ b/gen/aa.cpp Sat Jul 26 17:19:16 2008 +0200 @@ -14,7 +14,7 @@ // makes sure the key value lives in memory so it can be passed to the runtime functions without problems // returns the pointer -static LLValue* to_pkey(DValue* key) +static LLValue* to_pkey(Loc& loc, DValue* key) { Type* keytype = key->getType(); bool needmem = !DtoIsPassedByRef(keytype); @@ -38,7 +38,7 @@ else { LLValue* tmp = new llvm::AllocaInst(DtoType(keytype), "aatmpkeystorage", gIR->topallocapoint()); DVarValue* var = new DVarValue(keytype, tmp, true); - DtoAssign(var, key); + DtoAssign(loc, var, key); return tmp; } @@ -62,7 +62,7 @@ ///////////////////////////////////////////////////////////////////////////////////// -DValue* DtoAAIndex(Type* type, DValue* aa, DValue* key) +DValue* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key) { // call: // extern(C) void* _aaGet(AA* aa, TypeInfo keyti, void* pkey, size_t valuesize) @@ -83,7 +83,7 @@ LLValue* valsize = DtoConstSize_t(getABITypeSize(DtoType(type))); // pkey param - LLValue* pkey = to_pkey(key); + LLValue* pkey = to_pkey(loc, key); pkey = DtoBitCast(pkey, funcTy->getParamType(3)); // call runtime @@ -99,7 +99,7 @@ ///////////////////////////////////////////////////////////////////////////////////// -DValue* DtoAAIn(Type* type, DValue* aa, DValue* key) +DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key) { // call: // extern(C) void* _aaIn(AA aa*, TypeInfo keyti, void* pkey) @@ -121,7 +121,7 @@ keyti = DtoBitCast(keyti, funcTy->getParamType(1)); // pkey param - LLValue* pkey = to_pkey(key); + LLValue* pkey = to_pkey(loc, key); pkey = DtoBitCast(pkey, funcTy->getParamType(2)); // call runtime @@ -137,7 +137,7 @@ ///////////////////////////////////////////////////////////////////////////////////// -void DtoAARemove(DValue* aa, DValue* key) +void DtoAARemove(Loc& loc, DValue* aa, DValue* key) { // call: // extern(C) void _aaDel(AA aa, TypeInfo keyti, void* pkey) @@ -159,7 +159,7 @@ keyti = DtoBitCast(keyti, funcTy->getParamType(1)); // pkey param - LLValue* pkey = to_pkey(key); + LLValue* pkey = to_pkey(loc, key); pkey = DtoBitCast(pkey, funcTy->getParamType(2)); // build arg vector