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 | 963cc31583f7b80b0c8af6c0de16ee196e7de5d9 (patch) | |
tree | e47f3daf1168c25c6d5b7a8b36bc180451656ea7 /clang/lib | |
parent | 3990850a7d2e2964c8d6b9190b2e383051c81d96 (diff) | |
download | bcm5719-llvm-963cc31583f7b80b0c8af6c0de16ee196e7de5d9.tar.gz bcm5719-llvm-963cc31583f7b80b0c8af6c0de16ee196e7de5d9.zip |
Add doxygen comments and simplify expression.
llvm-svn: 76955
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/CFG.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index af64fb84144..217df459b8b 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/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(); } |