mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 08:56:15 +08:00
remove a bogus assertion, add a comment.
llvm-svn: 126603
This commit is contained in:
@@ -857,9 +857,6 @@ static CSFC_Result CollectStatementsForCase(const Stmt *S,
|
||||
const SwitchCase *Case,
|
||||
bool &FoundCase,
|
||||
llvm::SmallVectorImpl<const Stmt*> &ResultStmts) {
|
||||
assert((!FoundCase || Case == 0) &&
|
||||
"Can't be looking for the case if we already found it!");
|
||||
|
||||
// If this is a null statement, just succeed.
|
||||
if (S == 0)
|
||||
return Case ? CSFC_Success : CSFC_FallThrough;
|
||||
@@ -942,6 +939,7 @@ static CSFC_Result CollectStatementsForCase(const Stmt *S,
|
||||
// just verify it doesn't have labels, which would make it invalid to elide.
|
||||
if (Case) {
|
||||
if (CodeGenFunction::ContainsLabel(S, true) ||
|
||||
// Don't skip over DeclStmts, which can be used even if skipped over.
|
||||
isa<DeclStmt>(S))
|
||||
return CSFC_Failure;
|
||||
return CSFC_Success;
|
||||
|
||||
@@ -167,3 +167,16 @@ void test9(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int test10(void) {
|
||||
switch(8) {
|
||||
case 8:
|
||||
break;
|
||||
case 4:
|
||||
break;
|
||||
default:
|
||||
dead();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user