diff options
Diffstat (limited to 'clang/AST')
| -rw-r--r-- | clang/AST/Expr.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/AST/Expr.cpp b/clang/AST/Expr.cpp index d6960d35e27..0c631df5c04 100644 --- a/clang/AST/Expr.cpp +++ b/clang/AST/Expr.cpp @@ -894,6 +894,14 @@ ObjCMessageExpr::ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo, RBracloc = RBrac; } + +bool ChooseExpr::isConditionTrue(ASTContext &C) const { + llvm::APSInt CondVal(32); + bool IsConst = getCond()->isIntegerConstantExpr(CondVal, C); + assert(IsConst && "Condition of choose expr must be i-c-e"); IsConst=IsConst; + return CondVal != 0; +} + //===----------------------------------------------------------------------===// // Child Iterators for iterating over subexpressions/substatements //===----------------------------------------------------------------------===// |

