@@ -698,13 +698,7 @@ const ASTReturnStatementNode *ASTFunctionDefinitionNode::CheckReturnStatements(
698
698
}
699
699
700
700
const ASTDefaultStatementNode *DSN = SWS->GetDefaultStatement ();
701
- if (!DSN) {
702
- std::stringstream M;
703
- M << " Switch statement without a default label." ;
704
- QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
705
- DIAGLineCounter::Instance ().GetLocation (SWS), M.str (),
706
- DiagLevel::Warning);
707
- } else {
701
+ if (DSN) {
708
702
const ASTStatementList *DSL = DSN->GetStatementList ();
709
703
assert (DSL && " Could not obtain a valid ASTStatementList!" );
710
704
@@ -849,13 +843,7 @@ const ASTReturnStatementNode *ASTFunctionDefinitionNode::CheckReturnStatements(
849
843
}
850
844
851
845
const ASTDefaultStatementNode *DSN = SWS->GetDefaultStatement ();
852
- if (!DSN) {
853
- std::stringstream M;
854
- M << " Switch statement without a default label." ;
855
- QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
856
- DIAGLineCounter::Instance ().GetLocation (SWS), M.str (),
857
- DiagLevel::Warning);
858
- } else {
846
+ if (DSN) {
859
847
const ASTStatementList *DSL = DSN->GetStatementList ();
860
848
assert (DSL && " Could not obtain a valid ASTStatementList!" );
861
849
@@ -1000,13 +988,7 @@ const ASTReturnStatementNode *ASTFunctionDefinitionNode::CheckReturnStatements(
1000
988
}
1001
989
1002
990
const ASTDefaultStatementNode *DSN = SWS->GetDefaultStatement ();
1003
- if (!DSN) {
1004
- std::stringstream M;
1005
- M << " Switch statement without a default label." ;
1006
- QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
1007
- DIAGLineCounter::Instance ().GetLocation (SWS), M.str (),
1008
- DiagLevel::Warning);
1009
- } else {
991
+ if (DSN) {
1010
992
const ASTStatementList *DSL = DSN->GetStatementList ();
1011
993
assert (DSL && " Could not obtain a valid ASTStatementList!" );
1012
994
@@ -1153,13 +1135,7 @@ const ASTReturnStatementNode *ASTFunctionDefinitionNode::CheckReturnStatements(
1153
1135
1154
1136
const ASTDefaultStatementNode *DSN =
1155
1137
SWS->GetDefaultStatement ();
1156
- if (!DSN) {
1157
- std::stringstream M;
1158
- M << " Switch statement without a default label." ;
1159
- QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
1160
- DIAGLineCounter::Instance ().GetLocation (SWS), M.str (),
1161
- DiagLevel::Warning);
1162
- } else {
1138
+ if (DSN) {
1163
1139
const ASTStatementList *DSL = DSN->GetStatementList ();
1164
1140
assert (DSL && " Could not obtain a valid ASTStatementList!" );
1165
1141
@@ -1306,13 +1282,7 @@ const ASTReturnStatementNode *ASTFunctionDefinitionNode::CheckReturnStatements(
1306
1282
1307
1283
const ASTDefaultStatementNode *DSN =
1308
1284
SWS->GetDefaultStatement ();
1309
- if (!DSN) {
1310
- std::stringstream M;
1311
- M << " Switch statement without a default label." ;
1312
- QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
1313
- DIAGLineCounter::Instance ().GetLocation (SWS), M.str (),
1314
- DiagLevel::Warning);
1315
- } else {
1285
+ if (DSN) {
1316
1286
const ASTStatementList *DSL = DSN->GetStatementList ();
1317
1287
assert (DSL && " Could not obtain a valid ASTStatementList!" );
1318
1288
@@ -1459,13 +1429,7 @@ const ASTReturnStatementNode *ASTFunctionDefinitionNode::CheckReturnStatements(
1459
1429
1460
1430
const ASTDefaultStatementNode *DSN =
1461
1431
SWS->GetDefaultStatement ();
1462
- if (!DSN) {
1463
- std::stringstream M;
1464
- M << " Switch statement without a default label." ;
1465
- QasmDiagnosticEmitter::Instance ().EmitDiagnostic (
1466
- DIAGLineCounter::Instance ().GetLocation (SWS), M.str (),
1467
- DiagLevel::Warning);
1468
- } else {
1432
+ if (DSN) {
1469
1433
const ASTStatementList *DSL = DSN->GetStatementList ();
1470
1434
assert (DSL && " Could not obtain a valid ASTStatementList!" );
1471
1435
0 commit comments