diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-11-13 00:47:57 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-11-13 00:47:57 +0000 |
commit | f75c823e5c2ab23878c060e0825b9fe99fac2d52 (patch) | |
tree | 7d124059b76d0cd38563b05d02a9a03372c8bf12 | |
parent | ce9082ad5cafb7c066f856403b225cc0279b2dad (diff) | |
download | bcm5719-llvm-f75c823e5c2ab23878c060e0825b9fe99fac2d52.tar.gz bcm5719-llvm-f75c823e5c2ab23878c060e0825b9fe99fac2d52.zip |
For if blocks with no else, name the join block ifend instead of the
more confusing ifelse.
Use dotted names for if blocks (if.then vs ifthen).
llvm-svn: 59201
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index e40508669ab..a66b6fec041 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -250,13 +250,12 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) { // Otherwise, the condition did not fold, or we couldn't elide it. Just emit // the conditional branch. - llvm::BasicBlock *ThenBlock = createBasicBlock("ifthen"); - llvm::BasicBlock *ElseBlock = createBasicBlock("ifelse"); - EmitBranchOnBoolExpr(S.getCond(), ThenBlock, ElseBlock); - - llvm::BasicBlock *ContBlock = ElseBlock; + llvm::BasicBlock *ThenBlock = createBasicBlock("if.then"); + llvm::BasicBlock *ContBlock = createBasicBlock("if.end"); + llvm::BasicBlock *ElseBlock = ContBlock; if (S.getElse()) - ContBlock = createBasicBlock("ifend"); + ElseBlock = createBasicBlock("if.else"); + EmitBranchOnBoolExpr(S.getCond(), ThenBlock, ElseBlock); // Emit the 'then' code. EmitBlock(ThenBlock); |