| 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 |
no test coverage detected