diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-23 23:44:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-23 23:44:04 +0000 |
commit | 633caca35396864f9de09b3dae6e165d917ce698 (patch) | |
tree | 2a5540826621e653e8bc0e50db0bccc8b9d7ec9c /clang/lib/CodeGen | |
parent | 8a9fa3af6911f61fe71df752aaba6d6f292563ae (diff) | |
download | bcm5719-llvm-633caca35396864f9de09b3dae6e165d917ce698.tar.gz bcm5719-llvm-633caca35396864f9de09b3dae6e165d917ce698.zip |
Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.
llvm-svn: 89717
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index b6d7b399045..1c3f3577947 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -294,6 +294,8 @@ void CodeGenFunction::EmitIndirectGotoStmt(const IndirectGotoStmt &S) { void CodeGenFunction::EmitIfStmt(const IfStmt &S) { // C99 6.8.4.1: The first substatement is executed if the expression compares // unequal to 0. The condition must be a scalar type. + if (S.getConditionVariable()) + EmitDecl(*S.getConditionVariable()); // If the condition constant folds and can be elided, try to avoid emitting // the condition and the dead arm of the if/else. |