HomePhabricator

[analyzer] Unroll the loop when it has a unsigned counter.

Description

[analyzer] Unroll the loop when it has a unsigned counter.

Summary:
The original implementation in the LoopUnrolling.cpp didn't consider the case where the counter is unsigned. This case is only handled in simpleCondition(), but this is not enough, we also need to deal with the unsinged counter with the counter initialization.

Since IntegerLiteral is signed, there is a ImplicitCastExpr<IntegralCast> in unsigned counter = IntergerLiteral. This patch add the ignoringParenImpCasts() in the IntegerLiteral matcher.

Reviewers: szepet, a.sidorin, NoQ, george.karpenkov

Reviewed By: szepet, george.karpenkov

Subscribers: xazax.hun, rnkovacs, cfe-commits, MTC

Differential Revision: https://reviews.llvm.org/D45086

Details

Committed
henrywongMar 31 2018, 5:46 AM
Reviewer
szepet
Differential Revision
D45086: [analyzer] Unroll the loop when it has a unsigned counter.
Parents
rL328918: [X86][Btver2] Add MMX_PSHUFB to the JWritePSHUFB InstRW entries
Branches
Unknown
Tags
Unknown