Mercurial > projects > ldc
annotate gen/aa.cpp @ 506:a6c105aa00d5
Provided overload to TypeClass::builtinTypeInfo to return true.
Shouldn't almost all types have a builtin typeinfo? Maybe it'd be better to
have the default at true and only overload typedef and friends.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Wed, 13 Aug 2008 22:14:43 +0200 |
parents | 672eb4893b55 |
children | fbb1a366cfbc |
rev | line source |
---|---|
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
1 #include "gen/llvm.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
2 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
3 #include "mtype.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
4 #include "declaration.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
5 #include "aggregate.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
6 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
7 #include "gen/aa.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
8 #include "gen/runtime.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
9 #include "gen/tollvm.h" |
244
a95056b3c996
[svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
217
diff
changeset
|
10 #include "gen/llvmhelpers.h" |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
11 #include "gen/logger.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
12 #include "gen/irstate.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
13 #include "gen/dvalue.h" |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
14 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
15 // makes sure the key value lives in memory so it can be passed to the runtime functions without problems |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
16 // returns the pointer |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
17 static LLValue* to_pkey(Loc& loc, DValue* key) |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
18 { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
19 Type* keytype = key->getType(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
20 bool needmem = !DtoIsPassedByRef(keytype); |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
21 LLValue* pkey; |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
22 if (key->isIm()) { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
23 pkey = key->getRVal(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
24 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
25 else if (DVarValue* var = key->isVar()) { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
26 if (var->lval) { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
27 pkey = key->getLVal(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
28 needmem = false; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
29 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
30 else { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
31 pkey = key->getRVal(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
32 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
33 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
34 else if (key->isConst()) { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
35 needmem = true; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
36 pkey = key->getRVal(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
37 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
38 else { |
479
672eb4893b55
Move AllocaInst creation into DtoAlloca helper. Will enable special zero-init of fp80 reals' padding.
Christian Kamm <kamm incasoftware de>
parents:
468
diff
changeset
|
39 LLValue* tmp = DtoAlloca(DtoType(keytype), "aatmpkeystorage"); |
168
08cfde5f70d3
[svn r184] fixed an AA helper for giving keys storage, which the runtime needs. tango.text.UnicodeData now compiles.
lindquist
parents:
163
diff
changeset
|
40 DVarValue* var = new DVarValue(keytype, tmp, true); |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
41 DtoAssign(loc, var, key); |
168
08cfde5f70d3
[svn r184] fixed an AA helper for giving keys storage, which the runtime needs. tango.text.UnicodeData now compiles.
lindquist
parents:
163
diff
changeset
|
42 return tmp; |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
43 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
44 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
45 // give memory |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
46 if (needmem) { |
479
672eb4893b55
Move AllocaInst creation into DtoAlloca helper. Will enable special zero-init of fp80 reals' padding.
Christian Kamm <kamm incasoftware de>
parents:
468
diff
changeset
|
47 LLValue* tmp = DtoAlloca(DtoType(keytype), "aatmpkeystorage"); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
48 DtoStore(pkey, tmp); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
49 pkey = tmp; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
50 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
51 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
52 return pkey; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
53 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
54 |
127 | 55 // returns the keytype typeinfo |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
56 static LLValue* to_keyti(DValue* key) |
127 | 57 { |
58 // keyti param | |
59 Type* keytype = key->getType(); | |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
60 return DtoTypeInfoOf(keytype, false); |
127 | 61 } |
62 | |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
63 ///////////////////////////////////////////////////////////////////////////////////// |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
64 |
458
121624c14053
Fixed AA Rvalue-only access (like indexing an AA return value immediately).
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
455
diff
changeset
|
65 DValue* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key, bool lvalue) |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
66 { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
67 // call: |
458
121624c14053
Fixed AA Rvalue-only access (like indexing an AA return value immediately).
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
455
diff
changeset
|
68 // extern(C) void* _aaGet(AA* aa, TypeInfo keyti, size_t valuesize, void* pkey) |
121624c14053
Fixed AA Rvalue-only access (like indexing an AA return value immediately).
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
455
diff
changeset
|
69 // or |
121624c14053
Fixed AA Rvalue-only access (like indexing an AA return value immediately).
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
455
diff
changeset
|
70 // extern(C) void* _aaGetRvalue(AA aa, TypeInfo keyti, size_t valuesize, void* pkey) |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
71 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
72 // first get the runtime function |
458
121624c14053
Fixed AA Rvalue-only access (like indexing an AA return value immediately).
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
455
diff
changeset
|
73 llvm::Function* func = LLVM_D_GetRuntimeFunction(gIR->module, lvalue?"_aaGet":"_aaGetRvalue"); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
74 const llvm::FunctionType* funcTy = func->getFunctionType(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
75 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
76 // aa param |
458
121624c14053
Fixed AA Rvalue-only access (like indexing an AA return value immediately).
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
455
diff
changeset
|
77 LLValue* aaval = lvalue ? aa->getLVal() : aa->getRVal(); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
78 aaval = DtoBitCast(aaval, funcTy->getParamType(0)); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
79 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
80 // keyti param |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
81 LLValue* keyti = to_keyti(key); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
82 keyti = DtoBitCast(keyti, funcTy->getParamType(1)); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
83 |
163
a8cd9bc1021a
[svn r179] lots and lots of fixes, much more of tango now compiles/works.
lindquist
parents:
156
diff
changeset
|
84 // valuesize param |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
85 LLValue* valsize = DtoConstSize_t(getABITypeSize(DtoType(type))); |
163
a8cd9bc1021a
[svn r179] lots and lots of fixes, much more of tango now compiles/works.
lindquist
parents:
156
diff
changeset
|
86 |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
87 // pkey param |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
88 LLValue* pkey = to_pkey(loc, key); |
163
a8cd9bc1021a
[svn r179] lots and lots of fixes, much more of tango now compiles/works.
lindquist
parents:
156
diff
changeset
|
89 pkey = DtoBitCast(pkey, funcTy->getParamType(3)); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
90 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
91 // call runtime |
315
a9697749e898
[svn r336] Made sure calls within a landing pad area are invokes.
ChristianK
parents:
275
diff
changeset
|
92 LLValue* ret = gIR->CreateCallOrInvoke4(func, aaval, keyti, valsize, pkey, "aa.index")->get(); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
93 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
94 // cast return value |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
95 const LLType* targettype = getPtrToType(DtoType(type)); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
96 if (ret->getType() != targettype) |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
97 ret = DtoBitCast(ret, targettype); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
98 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
99 return new DVarValue(type, ret, true); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
100 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
101 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
102 ///////////////////////////////////////////////////////////////////////////////////// |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
103 |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
104 DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key) |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
105 { |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
106 // call: |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
107 // extern(C) void* _aaIn(AA aa*, TypeInfo keyti, void* pkey) |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
108 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
109 // first get the runtime function |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
110 llvm::Function* func = LLVM_D_GetRuntimeFunction(gIR->module, "_aaIn"); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
111 const llvm::FunctionType* funcTy = func->getFunctionType(); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
112 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
113 Logger::cout() << "_aaIn = " << *func << '\n'; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
114 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
115 // aa param |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
116 LLValue* aaval = aa->getRVal(); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
117 Logger::cout() << "aaval: " << *aaval << '\n'; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
118 Logger::cout() << "totype: " << *funcTy->getParamType(0) << '\n'; |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
119 aaval = DtoBitCast(aaval, funcTy->getParamType(0)); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
120 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
121 // keyti param |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
122 LLValue* keyti = to_keyti(key); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
123 keyti = DtoBitCast(keyti, funcTy->getParamType(1)); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
124 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
125 // pkey param |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
126 LLValue* pkey = to_pkey(loc, key); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
127 pkey = DtoBitCast(pkey, funcTy->getParamType(2)); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
128 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
129 // call runtime |
315
a9697749e898
[svn r336] Made sure calls within a landing pad area are invokes.
ChristianK
parents:
275
diff
changeset
|
130 LLValue* ret = gIR->CreateCallOrInvoke3(func, aaval, keyti, pkey, "aa.in")->get(); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
131 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
132 // cast return value |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
133 const LLType* targettype = DtoType(type); |
109
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
134 if (ret->getType() != targettype) |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
135 ret = DtoBitCast(ret, targettype); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
136 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
137 return new DImValue(type, ret); |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
138 } |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
139 |
5ab8e92611f9
[svn r113] Added initial support for associative arrays (AAs).
lindquist
parents:
diff
changeset
|
140 ///////////////////////////////////////////////////////////////////////////////////// |
127 | 141 |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
142 void DtoAARemove(Loc& loc, DValue* aa, DValue* key) |
127 | 143 { |
144 // call: | |
145 // extern(C) void _aaDel(AA aa, TypeInfo keyti, void* pkey) | |
146 | |
147 // first get the runtime function | |
148 llvm::Function* func = LLVM_D_GetRuntimeFunction(gIR->module, "_aaDel"); | |
149 const llvm::FunctionType* funcTy = func->getFunctionType(); | |
150 | |
151 Logger::cout() << "_aaDel = " << *func << '\n'; | |
152 | |
153 // aa param | |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
154 LLValue* aaval = aa->getRVal(); |
127 | 155 Logger::cout() << "aaval: " << *aaval << '\n'; |
156 Logger::cout() << "totype: " << *funcTy->getParamType(0) << '\n'; | |
157 aaval = DtoBitCast(aaval, funcTy->getParamType(0)); | |
158 | |
159 // keyti param | |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
160 LLValue* keyti = to_keyti(key); |
127 | 161 keyti = DtoBitCast(keyti, funcTy->getParamType(1)); |
162 | |
163 // pkey param | |
399
0e6b4d65d3f8
Give error messages for invalid casts.
Christian Kamm <kamm incasoftware de>
parents:
315
diff
changeset
|
164 LLValue* pkey = to_pkey(loc, key); |
127 | 165 pkey = DtoBitCast(pkey, funcTy->getParamType(2)); |
166 | |
167 // build arg vector | |
213
7816aafeea3c
[svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents:
173
diff
changeset
|
168 LLSmallVector<LLValue*, 3> args; |
127 | 169 args.push_back(aaval); |
170 args.push_back(keyti); | |
171 args.push_back(pkey); | |
172 | |
173 // call runtime | |
315
a9697749e898
[svn r336] Made sure calls within a landing pad area are invokes.
ChristianK
parents:
275
diff
changeset
|
174 gIR->CreateCallOrInvoke(func, args.begin(), args.end()); |
127 | 175 } |