* record the LHS/RHS types of comparisons between pointers */
| 379 | * record the LHS/RHS types of comparisons between pointers |
| 380 | */ |
| 381 | void |
| 382 | Bookkeeper::record_pointer_comparisons(const Expression* lhs, const Expression* rhs) |
| 383 | { |
| 384 | if (lhs->term_type != eFunction && rhs->term_type != eFunction) { |
| 385 | assert(lhs->get_type().eType == ePointer && rhs->get_type().eType == ePointer); |
| 386 | if ((lhs->term_type == eVariable && rhs->term_type == eConstant) || |
| 387 | (rhs->term_type == eVariable && lhs->term_type == eConstant)) { |
| 388 | cmp_ptr_to_null++; |
| 389 | } |
| 390 | else if (lhs->term_type==eVariable && rhs->term_type==eVariable) { |
| 391 | const ExpressionVariable* left = (ExpressionVariable*)lhs; |
| 392 | const ExpressionVariable* right = (ExpressionVariable*)rhs; |
| 393 | if (left->get_indirect_level() == right->get_indirect_level()) { |
| 394 | cmp_ptr_to_ptr++; |
| 395 | } |
| 396 | else { |
| 397 | cmp_ptr_to_addr++; |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | /* |
| 404 | * count volatile/non-volatile reads/writes, specifically access thru pointers |
nothing calls this directly
no test coverage detected