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

Method createTokensCall

lib/clangimport.cpp:1324–1363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1322}
1323
1324Token * clangimport::AstNode::createTokensCall(TokenList &tokenList)
1325{
1326 int firstParam;
1327 Token *f;
1328 if (nodeType == CXXOperatorCallExpr) {
1329 firstParam = 2;
1330 Token *obj = getChild(1)->createTokens(tokenList);
1331 Token *dot = addtoken(tokenList, ".");
1332 Token *op = getChild(0)->createTokens(tokenList);
1333 dot->astOperand1(obj);
1334 dot->astOperand2(op);
1335 f = dot;
1336 } else {
1337 firstParam = 1;
1338 f = getChild(0)->createTokens(tokenList);
1339 }
1340 f->setValueType(nullptr);
1341 Token *par1 = addtoken(tokenList, "(");
1342 par1->astOperand1(f);
1343 std::size_t args = 0;
1344 while (args < children.size() && children[args]->nodeType != CXXDefaultArgExpr)
1345 args++;
1346 Token *child = nullptr;
1347 for (std::size_t c = firstParam; c < args; ++c) {
1348 if (child) {
1349 Token *comma = addtoken(tokenList, ",");
1350 comma->setValueType(nullptr);
1351 comma->astOperand1(child);
1352 comma->astOperand2(children[c]->createTokens(tokenList));
1353 child = comma;
1354 } else {
1355 child = children[c]->createTokens(tokenList);
1356 }
1357 }
1358 par1->astOperand2(child);
1359 Token *par2 = addtoken(tokenList, ")");
1360 par1->link(par2);
1361 par2->link(par1);
1362 return par1;
1363}
1364
1365void clangimport::AstNode::createTokensFunctionDecl(TokenList &tokenList)
1366{

Callers

nothing calls this directly

Calls 5

astOperand1Method · 0.80
astOperand2Method · 0.80
createTokensMethod · 0.45
setValueTypeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected