Return whether tok is in the body for a function returning a boolean. */
| 281 | |
| 282 | /* Return whether tok is in the body for a function returning a boolean. */ |
| 283 | static bool inBooleanFunction(const Token *tok) |
| 284 | { |
| 285 | const Scope *scope = tok ? tok->scope() : nullptr; |
| 286 | while (scope && scope->isLocal()) |
| 287 | scope = scope->nestedIn; |
| 288 | if (scope && scope->type == ScopeType::eFunction) { |
| 289 | const Function *func = scope->function; |
| 290 | if (func) { |
| 291 | const Token *ret = func->retDef; |
| 292 | while (Token::Match(ret, "static|const")) |
| 293 | ret = ret->next(); |
| 294 | return Token::Match(ret, "bool|_Bool"); |
| 295 | } |
| 296 | } |
| 297 | return false; |
| 298 | } |
| 299 | |
| 300 | static bool isOperandExpanded(const Token *tok) |
| 301 | { |
no test coverage detected