diff options
author | Eric Christopher <echristo@apple.com> | 2012-04-10 18:20:19 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-04-10 18:20:19 +0000 |
commit | 0241e32304d290768662748b221146ea7e8380f1 (patch) | |
tree | ee6074fa5814680456d6820dc32315585dfafdb4 /clang/lib/CodeGen/CGStmt.cpp | |
parent | b10973af64888be2dc3ebabd34a266bc04bba457 (diff) | |
download | bcm5719-llvm-0241e32304d290768662748b221146ea7e8380f1.tar.gz bcm5719-llvm-0241e32304d290768662748b221146ea7e8380f1.zip |
For debug and coverage analysis if we're not optimizing go ahead
and emit a relatively empty block for a plain break statement. This
enables us to track where we went through a switch.
PR9796 & rdar://11215207
llvm-svn: 154420
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index f442bc23672..bf42dcb8e21 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -892,7 +892,7 @@ void CodeGenFunction::EmitCaseStmt(const CaseStmt &S) { // If the body of the case is just a 'break', and if there was no fallthrough, // try to not emit an empty block. - if (isa<BreakStmt>(S.getSubStmt())) { + if ((CGM.getCodeGenOpts().OptimizationLevel > 0) && isa<BreakStmt>(S.getSubStmt())) { JumpDest Block = BreakContinueStack.back().BreakBlock; // Only do this optimization if there are no cleanups that need emitting. |