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

Function getContainerYield

lib/vf_settokenvalue.cpp:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48namespace ValueFlow
49{
50 static Library::Container::Yield getContainerYield(Token* tok, const Library& library, Token*& parent)
51 {
52 if (Token::Match(tok, ". %name% (") && tok->astParent() == tok->tokAt(2) && tok->astOperand1() &&
53 tok->astOperand1()->valueType()) {
54 const Library::Container* c = getLibraryContainer(tok->astOperand1());
55 parent = tok->astParent();
56 return c ? c->getYield(tok->strAt(1)) : Library::Container::Yield::NO_YIELD;
57 }
58 if (Token::Match(tok->previous(), "%name% (")) {
59 parent = tok;
60 if (const Library::Function* f = library.getFunction(tok->previous())) {
61 return f->containerYield;
62 }
63 }
64 return Library::Container::Yield::NO_YIELD;
65 }
66
67 static Value truncateImplicitConversion(Token* parent, const Value& value, const Settings& settings)
68 {

Callers 2

assertWithSideEffectsMethod · 0.85
setTokenValueFunction · 0.85

Calls 6

getLibraryContainerFunction · 0.85
astParentMethod · 0.80
astOperand1Method · 0.80
getYieldMethod · 0.80
tokAtMethod · 0.45
getFunctionMethod · 0.45

Tested by

no test coverage detected