diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-07-24 06:55:42 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-07-24 06:55:42 +0000 |
| commit | fadc9eaeac18b470b6dfcf9efcf5c4f8caea89bc (patch) | |
| tree | 1fbeb111949ce728990b912b2959060eecd78332 | |
| parent | 941fde8019d47c694b8483db45d5878818fa69d1 (diff) | |
Add doxygen comments and simplify expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76955 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Analysis/CFG.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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(); } |
