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

Method Add

LifetimeTracker.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43//-----------------------------------------------------------------------------
44
45void LifetimeTracker::Add(const VarDecl* decl)
46{
47 RETURN_IF(not GetInsightsOptions().ShowLifetime)
48
49 QualType type{decl->getType()};
50
51 RETURN_IF(type->isPointerType() or type->isRValueReferenceType());
52
53 // For life-time extended objects
54 // XXX contains in C++23
55 RETURN_IF(std::ranges::find_if(objects, [&](const auto& e) { return e.item == decl; }) != objects.end());
56
57 objects.push_back({decl, LifetimeEntry::FuncStart::No, scopeCounter});
58}
59//-----------------------------------------------------------------------------
60
61void LifetimeTracker::InsertDtorCall(const VarDecl* vd, OutputFormatHelper& ofm)

Callers 11

VisitCompoundStmtMethod · 0.45
VisitDeclStmtMethod · 0.45
VisitCoyieldExprMethod · 0.45
VisitCoawaitExprMethod · 0.45
InsertCoroutineMethod · 0.45
InsertArgMethod · 0.45
InsertArgMethod · 0.45
InsertMethodBodyMethod · 0.45
InsertArgMethod · 0.45
InsertCXXMethodDeclMethod · 0.45

Calls 1

endMethod · 0.45

Tested by

no test coverage detected