[cfe-commits] r44492 - /cfe/trunk/AST/Expr.cpp
Fariborz Jahanian
fjahanian at apple.com
Sat Dec 1 11:58:28 PST 2007
Author: fjahanian
Date: Sat Dec 1 13:58:28 2007
New Revision: 44492
URL: http://llvm.org/viewvc/llvm-project?rev=44492&view=rev
Log:
Compute side-effect for conditional expression.
Modified:
cfe/trunk/AST/Expr.cpp
Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=44492&r1=44491&r2=44492&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Sat Dec 1 13:58:28 2007
@@ -255,6 +255,13 @@
case CompoundAssignOperatorClass:
return true;
+ case ConditionalOperatorClass: {
+ const ConditionalOperator *Exp = cast<ConditionalOperator>(this);
+ return Exp->getCond()->hasLocalSideEffect()
+ || (Exp->getLHS() && Exp->getLHS()->hasLocalSideEffect())
+ || (Exp->getRHS() && Exp->getRHS()->hasLocalSideEffect());
+ }
+
case MemberExprClass:
case ArraySubscriptExprClass:
// If the base pointer or element is to a volatile pointer/field, accessing
More information about the cfe-commits
mailing list