Skip to content

Commit 44777f6

Browse files
committed
[Gardening] IRGen: clang-format this code.
1 parent 7bf535c commit 44777f6

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

lib/IRGen/GenFunc.cpp

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -872,33 +872,36 @@ llvm::Constant *irgen::getCoroFrameAllocStubFn(IRGenModule &IGM) {
872872
// Otherwise, create a stub function to call it when available, or malloc
873873
// when it isn't.
874874
return IGM.getOrCreateHelperFunction(
875-
"__swift_coroFrameAllocStub", IGM.Int8PtrTy,
876-
{IGM.SizeTy, IGM.Int64Ty},
877-
[&](IRGenFunction &IGF) {
878-
auto parameters = IGF.collectParameters();
879-
auto *size = parameters.claimNext();
880-
auto *coroFrameAllocFn = IGF.IGM.getOpaquePtr(coroAllocPtr);
881-
auto *nullSwiftCoroFrameAlloc = IGF.Builder.CreateCmp(
882-
llvm::CmpInst::Predicate::ICMP_NE, coroFrameAllocFn,
883-
llvm::ConstantPointerNull::get(
884-
cast<llvm::PointerType>(coroFrameAllocFn->getType())));
885-
auto *coroFrameAllocReturn = IGF.createBasicBlock("return-coroFrameAlloc");
886-
auto *mallocReturn = IGF.createBasicBlock("return-malloc");
887-
IGF.Builder.CreateCondBr(nullSwiftCoroFrameAlloc, coroFrameAllocReturn, mallocReturn);
888-
889-
IGF.Builder.emitBlock(coroFrameAllocReturn);
890-
auto *mallocTypeId = parameters.claimNext();
891-
auto *coroFrameAllocCall = IGF.Builder.CreateCall(IGF.IGM.getCoroFrameAllocFunctionPointer(), {size, mallocTypeId});
892-
IGF.Builder.CreateRet(coroFrameAllocCall);
893-
894-
IGF.Builder.emitBlock(mallocReturn);
895-
auto *mallocCall = IGF.Builder.CreateCall(IGF.IGM.getMallocFunctionPointer(), {size});
896-
IGF.Builder.CreateRet(mallocCall);
897-
},
898-
/*setIsNoInline=*/false,
899-
/*forPrologue=*/false,
900-
/*isPerformanceConstraint=*/false,
901-
/*optionalLinkageOverride=*/nullptr, llvm::CallingConv::C);
875+
"__swift_coroFrameAllocStub", IGM.Int8PtrTy, {IGM.SizeTy, IGM.Int64Ty},
876+
[&](IRGenFunction &IGF) {
877+
auto parameters = IGF.collectParameters();
878+
auto *size = parameters.claimNext();
879+
auto *coroFrameAllocFn = IGF.IGM.getOpaquePtr(coroAllocPtr);
880+
auto *nullSwiftCoroFrameAlloc = IGF.Builder.CreateCmp(
881+
llvm::CmpInst::Predicate::ICMP_NE, coroFrameAllocFn,
882+
llvm::ConstantPointerNull::get(
883+
cast<llvm::PointerType>(coroFrameAllocFn->getType())));
884+
auto *coroFrameAllocReturn =
885+
IGF.createBasicBlock("return-coroFrameAlloc");
886+
auto *mallocReturn = IGF.createBasicBlock("return-malloc");
887+
IGF.Builder.CreateCondBr(nullSwiftCoroFrameAlloc, coroFrameAllocReturn,
888+
mallocReturn);
889+
890+
IGF.Builder.emitBlock(coroFrameAllocReturn);
891+
auto *mallocTypeId = parameters.claimNext();
892+
auto *coroFrameAllocCall = IGF.Builder.CreateCall(
893+
IGF.IGM.getCoroFrameAllocFunctionPointer(), {size, mallocTypeId});
894+
IGF.Builder.CreateRet(coroFrameAllocCall);
895+
896+
IGF.Builder.emitBlock(mallocReturn);
897+
auto *mallocCall =
898+
IGF.Builder.CreateCall(IGF.IGM.getMallocFunctionPointer(), {size});
899+
IGF.Builder.CreateRet(mallocCall);
900+
},
901+
/*setIsNoInline=*/false,
902+
/*forPrologue=*/false,
903+
/*isPerformanceConstraint=*/false,
904+
/*optionalLinkageOverride=*/nullptr, llvm::CallingConv::C);
902905
}
903906

904907
static Size getOffsetOfOpaqueIsolationField(IRGenModule &IGM,

0 commit comments

Comments
 (0)