MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / analyzeLifetime

Function analyzeLifetime

lib/vf_analyzers.cpp:387–398  ·  view source on GitHub ↗

Returns Action::Match if its an exact match, return Action::Read if it partially matches the lifetime

Source from the content-addressed store, hash-verified

385private:
386 // Returns Action::Match if its an exact match, return Action::Read if it partially matches the lifetime
387 Action analyzeLifetime(const Token* tok) const
388 {
389 if (!tok)
390 return Action::None;
391 if (match(tok))
392 return Action::Match;
393 if (Token::simpleMatch(tok, ".") && analyzeLifetime(tok->astOperand1()) != Action::None)
394 return Action::Read;
395 if (astIsRHS(tok) && Token::simpleMatch(tok->astParent(), "."))
396 return analyzeLifetime(tok->astParent());
397 return Action::None;
398 }
399
400 std::unordered_map<nonneg int, const Token*> getSymbols(const Token* tok) const
401 {

Callers 1

analyzeTokenFunction · 0.85

Calls 5

astIsRHSFunction · 0.85
astOperand1Method · 0.80
astParentMethod · 0.80
matchFunction · 0.70
simpleMatchFunction · 0.70

Tested by

no test coverage detected