| 516 | //----------------------------------------------------------------------------- |
| 517 | |
| 518 | CXXRecordDecl* Struct(std::string_view name) |
| 519 | { |
| 520 | auto getRecord = [&] { |
| 521 | auto& ctx = GetGlobalAST(); |
| 522 | |
| 523 | return CXXRecordDecl::Create( |
| 524 | ctx, TagTypeKind::Struct, ctx.getTranslationUnitDecl(), {}, {}, &ctx.Idents.get(name), nullptr, false); |
| 525 | }; |
| 526 | |
| 527 | auto* rd = getRecord(); |
| 528 | rd->startDefinition(); |
| 529 | |
| 530 | // A "normal" struct has itself attached as a Decl. To make everything work do the same thing here |
| 531 | auto* selfDecl = getRecord(); |
| 532 | selfDecl->setAccess(AS_public); |
| 533 | rd->addDecl(selfDecl); |
| 534 | |
| 535 | return rd; |
| 536 | } |
| 537 | //----------------------------------------------------------------------------- |
| 538 | |
| 539 | FieldDecl* mkFieldDecl(DeclContext* dc, std::string_view name, QualType type) |
no test coverage detected