summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-04-10 18:20:19 +0000
committerEric Christopher <echristo@apple.com>2012-04-10 18:20:19 +0000
commit0241e32304d290768662748b221146ea7e8380f1 (patch)
treeee6074fa5814680456d6820dc32315585dfafdb4 /clang/lib/CodeGen/CGStmt.cpp
parentb10973af64888be2dc3ebabd34a266bc04bba457 (diff)
downloadbcm5719-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.cpp2
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.
OpenPOWER on IntegriCloud