Skip to content

Commit e37ffad

Browse files
committed
IRGen: adjust code for MSVC warning C4468 (NFCI)
``` The [[fallthrough]] attribute must be followed by a `case` label or a `default` label. ``` Restructure the code so that the `[[fallthrough]]` attribute is followed by the subsequent `case` label for the `switch` statement.
1 parent aea6b38 commit e37ffad

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,12 +2146,11 @@ static void emitEntryPointArgumentsNativeCC(IRGenSILFunction &IGF,
21462146
case SILCoroutineKind::None:
21472147
break;
21482148
case SILCoroutineKind::YieldOnce2:
2149-
if (IGF.IGM.IRGen.Opts.EmitYieldOnce2AsYieldOnce) {
2150-
LLVM_FALLTHROUGH;
2151-
} else {
2149+
if (!IGF.IGM.IRGen.Opts.EmitYieldOnce2AsYieldOnce) {
21522150
emitYieldOnce2CoroutineEntry(IGF, funcTy, *emission);
21532151
break;
21542152
}
2153+
LLVM_FALLTHROUGH;
21552154
case SILCoroutineKind::YieldOnce:
21562155
emitYieldOnceCoroutineEntry(IGF, funcTy, *emission);
21572156
break;
@@ -3866,12 +3865,10 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
38663865
break;
38673866

38683867
case SILCoroutineKind::YieldOnce2:
3869-
if (IGM.IRGen.Opts.EmitYieldOnce2AsYieldOnce) {
3870-
LLVM_FALLTHROUGH;
3871-
} else {
3872-
// @yield_once_2 coroutines allocate in the callee
3868+
// @yield_once_2 coroutines allocate in the callee
3869+
if (!IGM.IRGen.Opts.EmitYieldOnce2AsYieldOnce)
38733870
break;
3874-
}
3871+
LLVM_FALLTHROUGH;
38753872

38763873
case SILCoroutineKind::YieldOnce:
38773874
coroutineBuffer = emitAllocYieldOnceCoroutineBuffer(*this);

0 commit comments

Comments
 (0)