From: Ted Kremenek Date: Fri, 24 Jul 2009 06:55:42 +0000 (+0000) Subject: Add doxygen comments and simplify expression. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fadc9eaeac18b470b6dfcf9efcf5c4f8caea89bc;p=clang Add doxygen comments and simplify expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76955 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index af64fb8414..217df459b8 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -135,6 +135,11 @@ private: bool FinishBlock(CFGBlock* B); CFGBlock *addStmt(Stmt *S) { return Visit(S, true); } + + /// TryResult - a class representing a variant over the values + /// 'true', 'false', or 'unknown'. This is returned by TryEvaluateBool, + /// and is used by the CFGBuilder to decide if a branch condition + /// can be decided up front during CFG construction. class TryResult { int X; public: @@ -155,7 +160,7 @@ private: TryResult TryEvaluateBool(Expr *S) { Expr::EvalResult Result; if (S->Evaluate(Result, *Context) && Result.Val.isInt()) - return Result.Val.getInt().getBoolValue() ? true : false; + return Result.Val.getInt().getBoolValue(); return TryResult(); }