@@ -1854,6 +1854,18 @@ namespace {
1854
1854
return func;
1855
1855
}
1856
1856
1857
+ void emitCallToConsumeEnumFunction (IRGenFunction &IGF, Explosion &src,
1858
+ SILType theEnumType) const {
1859
+ if (!consumeEnumFunction)
1860
+ consumeEnumFunction = emitConsumeEnumFunction (IGF.IGM , loweredType);
1861
+ Explosion tmp;
1862
+ fillExplosionForOutlinedCall (IGF, src, tmp);
1863
+ llvm::CallInst *call = IGF.Builder .CreateCallWithoutDbgLoc (
1864
+ consumeEnumFunction->getFunctionType (), consumeEnumFunction,
1865
+ tmp.claimAll ());
1866
+ call->setCallingConv (IGM.DefaultCC );
1867
+ }
1868
+
1857
1869
llvm::Function *emitConsumeEnumFunction (IRGenModule &IGM,
1858
1870
SILType theEnumType) const {
1859
1871
IRGenMangler Mangler;
@@ -2806,14 +2818,7 @@ namespace {
2806
2818
IGF.Builder .emitBlock (endBB);
2807
2819
return ;
2808
2820
}
2809
- if (!consumeEnumFunction)
2810
- consumeEnumFunction = emitConsumeEnumFunction (IGM, loweredType);
2811
- Explosion tmp;
2812
- fillExplosionForOutlinedCall (IGF, src, tmp);
2813
- llvm::CallInst *call = IGF.Builder .CreateCallWithoutDbgLoc (
2814
- consumeEnumFunction->getFunctionType (), consumeEnumFunction,
2815
- tmp.claimAll ());
2816
- call->setCallingConv (IGM.DefaultCC );
2821
+ emitCallToConsumeEnumFunction (IGF, src, loweredType);
2817
2822
return ;
2818
2823
}
2819
2824
0 commit comments