| 246 | } |
| 247 | |
| 248 | int getTupleFieldOffset ( TypeInfo * info, int index ) { |
| 249 | DAS_ASSERT(info->type==Type::tTuple); |
| 250 | DAS_ASSERT(uint32_t(index)<info->argCount); |
| 251 | int size = 0, idx = 0; |
| 252 | for (int i = 0, n = (int)info->argCount; i != n; ++i) { |
| 253 | TypeInfo * argT = info->argTypes[i]; |
| 254 | int al = getTypeAlign(argT) - 1; |
| 255 | size = (size + al) & ~al; |
| 256 | if ( idx==index ) { |
| 257 | return size; |
| 258 | } |
| 259 | size += getTypeSize(argT); |
| 260 | idx ++; |
| 261 | } |
| 262 | DAS_ASSERT(0 && "we should not even be here. field index out of range somehow???"); |
| 263 | return -1; |
| 264 | } |
| 265 | |
| 266 | static int getVariantAlign ( TypeInfo * info ) { |
| 267 | int al = getTypeBaseAlign(Type::tInt); |
no test coverage detected