MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / Struct

Function Struct

ASTHelpers.cpp:518–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516//-----------------------------------------------------------------------------
517
518CXXRecordDecl* 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
539FieldDecl* mkFieldDecl(DeclContext* dc, std::string_view name, QualType type)

Callers 3

InsertCoroutineMethod · 0.85
CfrontVtableDataMethod · 0.85
InsertArgMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected