r178309 - [analyzer] Apply the suppression rules to the nil receiver only if the value participates in the computation of the nil we warn about.

Jordan Rose jordan_rose at apple.com
Thu Mar 28 17:50:50 PDT 2013


I'm sad to have another one-shot visitor, rather than just doing the work up front in trackNullOrUndef. Now that suppression can take a significant portion of analysis time, we should probably not add new visitors as freely as we once would have.

> +  // The message send could be null if the receiver is null.
> +  if (const Expr *Receiver = NilReceiverBRVisitor::getReceiver(S)) {
> +    report.addVisitor(new NilReceiverBRVisitor(Receiver,
> +                                               EnableNullFPSuppression));
> +  }
> +

if (...) {
	trackNullOrUndefValue(N, Receiver, report);
}

This seems much more efficient—no restarting of path generation due to the new visitor.



More information about the cfe-commits mailing list