Usama, I heard you have plans to make isUnevaluated() consume statements so that you could feed the entire loop into the machine without separating it into parts. You can either update this patch or do that as a follow-up patch.
Also I think it's time for you to ask for commit access, so please do! (https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access)
I suspect this may lead to subtle bugs when a Stmt * that actually points to an Expr at runtime would cause the first overload to be chosen.
Maybe teach canResolveToExpr() to accept an Stmt instead (with early return)?
We're trying to avoid auto when it makes the code less readable i.e. when the type isn't obvious from the context (https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable).