| 2891 | } |
| 2892 | |
| 2893 | int TypeDecl::getTupleFieldOffset ( int index ) const { |
| 2894 | DAS_ASSERT(baseType==Type::tTuple); |
| 2895 | DAS_ASSERT(index>=0 && index<int(argTypes.size())); |
| 2896 | int size = 0, idx = 0; |
| 2897 | for ( const auto & argT : argTypes ) { |
| 2898 | int al = argT->getAlignOf() - 1; |
| 2899 | size = (size + al) & ~al; |
| 2900 | if ( idx==index ) { |
| 2901 | return size; |
| 2902 | } |
| 2903 | size += argT->getSizeOf(); |
| 2904 | idx ++; |
| 2905 | } |
| 2906 | DAS_ASSERT(0 && "we should not even be here. field index out of range somehow???"); |
| 2907 | return -1; |
| 2908 | } |
| 2909 | |
| 2910 | int TypeDecl::getTupleSize() const { |
| 2911 | uint64_t size = getTupleSize64(); |
no test coverage detected