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

Method simplifyDeclspec

lib/tokenize.cpp:9552–9573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9550}
9551
9552void Tokenizer::simplifyDeclspec()
9553{
9554 for (Token *tok = list.front(); tok; tok = tok->next()) {
9555 while (isAttribute(tok, false)) {
9556 if (Token::Match(tok->tokAt(2), "noreturn|nothrow|dllexport")) {
9557 Token *functok = getAttributeFuncTok(tok, false);
9558 if (functok) {
9559 if (tok->strAt(2) == "noreturn")
9560 functok->isAttributeNoreturn(true);
9561 else if (tok->strAt(2) == "nothrow")
9562 functok->isAttributeNothrow(true);
9563 else
9564 functok->isAttributeExport(true);
9565 }
9566 } else if (tok->strAt(2) == "property")
9567 tok->linkAt(1)->insertToken("__property");
9568
9569 Token::eraseTokens(tok, tok->linkAt(1)->next());
9570 tok->deleteThis();
9571 }
9572 }
9573}
9574
9575void Tokenizer::simplifyAttribute()
9576{

Callers

nothing calls this directly

Calls 7

isAttributeFunction · 0.85
frontMethod · 0.80
nextMethod · 0.80
insertTokenMethod · 0.80
linkAtMethod · 0.80
deleteThisMethod · 0.80
tokAtMethod · 0.45

Tested by

no test coverage detected