================
Comment at: lib/AST/Expr.cpp:2886-2887
@@ +2885,4 @@
+ /// \brief Look for any side effects within a Stmt.
+ class SideEffectFinder : public ConstEvaluatedExprVisitor<SideEffectFinder>
+ {
+ typedef ConstEvaluatedExprVisitor<SideEffectFinder> Inherited;
----------------
`{` goes on previous line.
================
Comment at: lib/AST/Expr.cpp:2901
@@ +2900,3 @@
+ if (!E->HasSideEffects(Context, IncludePossibleEffects)) {
+ Inherited::VisitStmt(E);
+ return;
----------------
Remove this call: you've already completely checked `E` and all of its
subexpressions for side-effects. Calling into the base class here will result
in a (worst-case) exponential-time search as both `VisitStmt` and
`HasSideEffects` will recurse into subexpressions at every level.
http://reviews.llvm.org/D10211
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits