diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-12 08:04:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-12 08:04:58 +0000 |
commit | 31a0984b5cb4af99d2407c0f25bf5af68df681c6 (patch) | |
tree | e1752760f7afede860249245b9aab7ef37bc3fa3 /lib/CodeGen/CodeGenFunction.h | |
parent | 210e0f57dbd10f6f2db60a9532a75d326b91fe0b (diff) |
Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger to
CodeGenFunction.cpp. Change VisitConditionalOperator to use
constant fold instead of codegen'ing a constant conditional.
Change ForStmt to use EmitBranchOnBoolExpr, this shrinks
expr.c very slightly to 40239 lines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 574e957eb9..d867c3f380 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -563,9 +563,19 @@ public: /// that we can just remove the code. static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts = false); -private: + /// ConstantFoldsToSimpleInteger - If the sepcified expression does not fold + /// to a constant, or if it does but contains a label, return 0. If it + /// constant folds to 'true' and does not contain a label, return 1, if it + /// constant folds to 'false' and does not contain a label, return -1. + int ConstantFoldsToSimpleInteger(const Expr *Cond); + + /// EmitBranchOnBoolExpr - Emit a branch on a boolean condition (e.g. for an + /// if statement) to the specified blocks. Based on the condition, this might + /// try to simplify the codegen of the conditional based on the branch. + /// void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, - llvm::BasicBlock *FalseBlock); + llvm::BasicBlock *FalseBlock); +private: /// EmitIndirectSwitches - Emit code for all of the switch /// instructions in IndirectSwitches. |