MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / getTypeBaseAlign

Function getTypeBaseAlign

src/simulate/debug_info.cpp:160–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158 }
159
160 int getTypeBaseAlign ( Type type ) {
161 switch ( type ) {
162 case anyArgument: return alignof(vec4f);
163 case tPointer: return alignof(void *);
164 case tIterator: return alignof(Sequence);
165 case tHandle: DAS_ASSERTF(0, "we should not be here. if this happens iterator was somehow placed on stack. how?");
166 return alignof(void *);
167 case tString: return alignof(char *);
168 case tBool: return alignof(bool); static_assert(alignof(bool)==1,"4 byte bool");
169 case tInt8: return alignof(int8_t);
170 case tUInt8: return alignof(uint8_t);
171 case tInt16: return alignof(int16_t);
172 case tUInt16: return alignof(uint16_t);
173 case tInt64: return alignof(int64_t);
174 case tUInt64: return alignof(uint64_t);
175 case tEnumeration: return alignof(int32_t);
176 case tEnumeration8: return alignof(int8_t);
177 case tEnumeration16:return alignof(int16_t);
178 case tEnumeration64:return alignof(int64_t);
179 case tInt: return alignof(int32_t);
180 case tInt2: return alignof(int2);
181 case tInt3: return alignof(int3);
182 case tInt4: return alignof(int4);
183 case tUInt: return alignof(uint32_t);
184 case tBitfield: return alignof(uint32_t);
185 case tBitfield8: return alignof(uint8_t);
186 case tBitfield16: return alignof(uint16_t);
187 case tBitfield64: return alignof(uint64_t);
188 case tUInt2: return alignof(uint2);
189 case tUInt3: return alignof(uint3);
190 case tUInt4: return alignof(uint4);
191 case tFloat: return alignof(float);
192 case tFloat2: return alignof(float2);
193 case tFloat3: return alignof(float3);
194 case tFloat4: return alignof(float4);
195 case tDouble: return alignof(double);
196 case tRange: return alignof(range);
197 case tURange: return alignof(urange);
198 case tRange64: return alignof(range64);
199 case tURange64: return alignof(urange64);
200 case tArray: return alignof(Array);
201 case tTable: return alignof(Table);
202 case tVoid: return 1;
203 case tBlock: return alignof(Block);
204 case tFunction: return alignof(Func);
205 case tLambda: return alignof(Lambda);
206 case tStructure: return 1;
207 case tTuple: return 1;
208 case tVariant: return 1;
209 case fakeContext: return 1;
210 case fakeLineInfo: return 1;
211 case alias: // sometimes its requestd by generic
212 case option:
213 case autoinfer: return 0;
214 default:
215 DAS_VERIFYF(0, "not implemented. likely new built-intype been added, and support has not been updated.");
216 return 1;
217 }

Callers 6

getVariantAlignFunction · 0.85
getTypeAlignFunction · 0.85
getVariantAlignMethod · 0.85
getVariantAlignFailedMethod · 0.85
getAlignOfMethod · 0.85
getAlignOfFailedMethod · 0.85

Calls 5

getStructAlignFunction · 0.85
getTupleAlignFunction · 0.85
getVariantAlignFunction · 0.85
getAnnotationMethod · 0.80
getAlignOfMethod · 0.45

Tested by

no test coverage detected