summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-28 00:18:40 +0000
committerChris Lattner <sabre@nondot.org>2011-02-28 00:18:40 +0000
commit29911cc2f5cad4dcdca30656f79855e8c2acb333 (patch)
treeb0032df9fe0b3231e676b6181c61603e2b931787 /clang/lib/CodeGen/CodeGenFunction.h
parent80d51eb03a40922450db96b5ac96ebb4eea9d93b (diff)
downloadbcm5719-llvm-29911cc2f5cad4dcdca30656f79855e8c2acb333.tar.gz
bcm5719-llvm-29911cc2f5cad4dcdca30656f79855e8c2acb333.zip
Add some helper methods that will be used in my next patch.
llvm-svn: 126596
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 7a94b92fbbe..0edd0f01281 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2044,11 +2044,21 @@ public:
/// that we can just remove the code.
static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts = false);
+ /// containsBreak - Return true if the statement contains a break out of it.
+ /// If the statement (recursively) contains a switch or loop with a break
+ /// inside of it, this is fine.
+ static bool containsBreak(const Stmt *S);
+
/// ConstantFoldsToSimpleInteger - If the specified expression does not fold
/// to a constant, or if it does but contains a label, return false. If it
/// constant folds return true and set the boolean result in Result.
bool ConstantFoldsToSimpleInteger(const Expr *Cond, bool &Result);
+ /// ConstantFoldsToSimpleInteger - If the specified expression does not fold
+ /// to a constant, or if it does but contains a label, return false. If it
+ /// constant folds return true and set the folded value.
+ bool ConstantFoldsToSimpleInteger(const Expr *Cond, llvm::APInt &Result);
+
/// 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.
OpenPOWER on IntegriCloud