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

Method getSizeOf64

src/ast/ast.cpp:460–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 }
459
460 uint64_t Structure::getSizeOf64() const {
461 if ( circularGuard ) return 1;
462 circularGuard = true;
463 uint64_t size = 0;
464 const Structure * cppLayoutParent = nullptr;
465 for ( const auto & fd : fields ) {
466 int fieldAlignemnt = fd.type->getAlignOf();
467 int al = fieldAlignemnt - 1;
468 if ( cppLayout ) {
469 auto fp = findFieldParent(fd.name);
470 if ( fp!=cppLayoutParent ) {
471 if (DAS_NON_POD_PADDING || !cppLayoutNotPod) {
472 size = cppLayoutParent ? cppLayoutParent->getSizeOf64() : 0;
473 }
474 cppLayoutParent = fp;
475 }
476 }
477 size = (size + al) & ~al;
478 size += fd.type->getSizeOf64();
479 }
480 circularGuard = false;
481 int al = getAlignOf() - 1;
482 size = (size + al) & ~al;
483 return size;
484 }
485
486 uint64_t Structure::getSizeOf64(bool & failed) const {
487 if ( circularGuard ) return 1;

Callers 9

setAllocateOnStackFunction · 0.45
emitScopeFreeMethod · 0.45
preVisitAliasMethod · 0.45
preVisitMethod · 0.45
preVisitGlobalLetMethod · 0.45
preVisitArgumentMethod · 0.45
preVisitBlockArgumentMethod · 0.45
visitStructureFieldMethod · 0.45
visitMethod · 0.45

Calls 3

findFieldParentFunction · 0.85
getAlignOfMethod · 0.45
getAlignOfFailedMethod · 0.45

Tested by

no test coverage detected