Mercurial > projects > ldc
comparison tangotests/vararg3.d @ 264:a9dae3da4e87 trunk
[svn r285] Fixed D -> bool LLVM helper for floating point values.
Changed the way D-style varargs are passed, now each param should be aligned to size_t.sizeof.
author | lindquist |
---|---|
date | Sat, 14 Jun 2008 17:28:13 +0200 |
parents | a58d8f4b84df |
children | 23d0d9855cad |
comparison
equal
deleted
inserted
replaced
263:2be09ee06bc7 | 264:a9dae3da4e87 |
---|---|
111 print("Done!\n"); | 111 print("Done!\n"); |
112 } | 112 } |
113 | 113 |
114 private void* get_va_arg(TypeInfo ti, ref void* vp) | 114 private void* get_va_arg(TypeInfo ti, ref void* vp) |
115 { | 115 { |
116 auto tisize = ti.tsize; | 116 void* arg = vp; |
117 assert(tisize); | 117 vp = vp + ( ( ti.tsize + size_t.sizeof - 1 ) & ~( size_t.sizeof - 1 ) ); |
118 size_t size = tisize > size_t.sizeof ? size_t.sizeof : tisize; | 118 return arg; |
119 void* vptmp = cast(void*)((cast(size_t)vp + size - 1) & ~(size - 1)); | |
120 vp = vptmp + tisize; | |
121 return vptmp; | |
122 } | 119 } |
123 | 120 |
124 void print(TypeInfo ti, void* arg) | 121 void print(TypeInfo ti, void* arg) |
125 { | 122 { |
126 if (ti == typeid(byte)) | 123 if (ti == typeid(byte)) |