зеркало из https://github.com/microsoft/clang-1.git
Compute side-effect for conditional expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
6e34049634
Коммит
ab38e4b502
|
@ -255,6 +255,13 @@ bool Expr::hasLocalSideEffect() const {
|
||||||
case CompoundAssignOperatorClass:
|
case CompoundAssignOperatorClass:
|
||||||
return true;
|
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 MemberExprClass:
|
||||||
case ArraySubscriptExprClass:
|
case ArraySubscriptExprClass:
|
||||||
// If the base pointer or element is to a volatile pointer/field, accessing
|
// If the base pointer or element is to a volatile pointer/field, accessing
|
||||||
|
|
Загрузка…
Ссылка в новой задаче