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

Function getArgumentPos

lib/astutils.cpp:98–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static int getArgumentPos(const Token* ftok, const Token* tokToFind){
99 const Token* tok = ftok;
100 if (Token::Match(tok, "%name% (|{"))
101 tok = ftok->next();
102 if (!Token::Match(tok, "(|{|["))
103 return -1;
104 const Token* startTok = tok->astOperand2();
105 if (!startTok && tok->next() != tok->link())
106 startTok = tok->astOperand1();
107 return findArgumentPos(startTok, tokToFind);
108}
109
110template<class T, class OuputIterator, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
111static void astFlattenCopy(T* tok, const char* op, OuputIterator out, int depth = 100)

Callers 5

getLifetimeTokensFunction · 0.85
fromFunctionArgMethod · 0.85
invalidatesContainerMethod · 0.85

Calls 6

findArgumentPosFunction · 0.85
nextMethod · 0.80
astOperand2Method · 0.80
astOperand1Method · 0.80
nameTokenMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected