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

Function makeClassRtti

src/ast/ast_generate.cpp:2190–2209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2188 }
2189
2190 void makeClassRtti ( Structure * baseClass ) {
2191 ExpressionPtr finit = new ExprTypeInfo(baseClass->at, "rtti_classinfo", new TypeDecl(baseClass));
2192 if ( baseClass->parent ) {
2193 auto fd = (Structure::FieldDeclaration *) baseClass->findField("__rtti");
2194 fd->init = finit;
2195 fd->parentType = fd->type->isAuto();
2196 fd->generated = true;
2197 } else {
2198 auto pvoid = new TypeDecl(Type::tPointer);
2199 pvoid->firstType = new TypeDecl(Type::tVoid);
2200 baseClass->fields.emplace_back(
2201 "__rtti",
2202 pvoid,
2203 finit,
2204 AnnotationArgumentList(),
2205 false,
2206 baseClass->at
2207 );
2208 }
2209 }
2210
2211 FunctionPtr makeClassFinalize ( Structure * baseClass ) {
2212 // add __finalize field

Callers 1

ast_structureDeclarationFunction · 0.85

Calls 3

isAutoMethod · 0.80
findFieldMethod · 0.45

Tested by

no test coverage detected