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

Method CfrontVtableData

CfrontCodeGenerator.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40//-----------------------------------------------------------------------------
41
42CfrontCodeGenerator::CfrontVtableData::CfrontVtableData()
43: vptpTypedef{Typedef("__vptp"sv, Function("vptp"sv, GetGlobalAST().IntTy, {})->getType())}
44, vtableRecorDecl{}
45{
46 vtableRecorDecl = Struct("__mptr"sv);
47 auto AddField = [&](FieldDecl* field) { vtableRecorDecl->addDecl(field); };
48
49 d = mkFieldDecl(vtableRecorDecl, "d"sv, GetGlobalAST().ShortTy);
50 AddField(d);
51 AddField(mkFieldDecl(vtableRecorDecl, "i"sv, GetGlobalAST().ShortTy));
52 f = mkFieldDecl(vtableRecorDecl, "f"sv, vptpTypedef);
53 AddField(f);
54
55 vtableRecorDecl->completeDefinition();
56
57 vtableRecordType = QualType{vtableRecorDecl->getTypeForDecl(), 0u};
58}
59//-----------------------------------------------------------------------------
60
61VarDecl* CfrontCodeGenerator::CfrontVtableData::VtblArrayVar(int size)

Callers

nothing calls this directly

Calls 5

TypedefFunction · 0.85
FunctionFunction · 0.85
StructFunction · 0.85
mkFieldDeclFunction · 0.85
AddFieldFunction · 0.85

Tested by

no test coverage detected