Skip to content

Commit a2150ba

Browse files
committed
[Coroutines] Clang format
1 parent 3903379 commit a2150ba

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

llvm/lib/Transforms/Coroutines/CoroCloner.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class CoroCloner {
5151
Function *NewF = nullptr;
5252
Value *NewFramePtr = nullptr;
5353

54-
5554
/// The active suspend instruction; meaningful only for continuation and async
5655
/// ABIs.
5756
AnyCoroSuspendInst *ActiveSuspend = nullptr;
@@ -62,7 +61,8 @@ class CoroCloner {
6261
TargetTransformInfo &TTI)
6362
: OrigF(OrigF), Suffix(Suffix), Shape(Shape),
6463
FKind(Shape.ABI == coro::ABI::Async ? Kind::Async : Kind::Continuation),
65-
Builder(OrigF.getContext()), TTI(TTI), NewF(NewF), ActiveSuspend(ActiveSuspend) {
64+
Builder(OrigF.getContext()), TTI(TTI), NewF(NewF),
65+
ActiveSuspend(ActiveSuspend) {
6666
assert(Shape.ABI == coro::ABI::Retcon ||
6767
Shape.ABI == coro::ABI::RetconOnce || Shape.ABI == coro::ABI::Async);
6868
assert(NewF && "need existing function for continuation");
@@ -71,11 +71,11 @@ class CoroCloner {
7171

7272
public:
7373
CoroCloner(Function &OrigF, const Twine &Suffix, coro::Shape &Shape,
74-
Kind FKind, TargetTransformInfo &TTI) :
75-
OrigF(OrigF), Suffix(Suffix), Shape(Shape), FKind(FKind), Builder(OrigF.getContext()), TTI(TTI) {
76-
}
74+
Kind FKind, TargetTransformInfo &TTI)
75+
: OrigF(OrigF), Suffix(Suffix), Shape(Shape), FKind(FKind),
76+
Builder(OrigF.getContext()), TTI(TTI) {}
7777

78-
virtual ~CoroCloner() { }
78+
virtual ~CoroCloner() {}
7979

8080
/// Create a clone for a continuation lowering.
8181
static Function *createClone(Function &OrigF, const Twine &Suffix,
@@ -122,13 +122,12 @@ class CoroCloner {
122122
void handleFinalSuspend();
123123
};
124124

125-
126125
class CoroSwitchCloner : public CoroCloner {
127126
protected:
128127
/// Create a cloner for a switch lowering.
129128
CoroSwitchCloner(Function &OrigF, const Twine &Suffix, coro::Shape &Shape,
130129
Kind FKind, TargetTransformInfo &TTI)
131-
: CoroCloner(OrigF, Suffix, Shape, FKind, TTI) { }
130+
: CoroCloner(OrigF, Suffix, Shape, FKind, TTI) {}
132131

133132
void create() override;
134133

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
//===----------------------------------------------------------------------===//
2020

2121
#include "llvm/Transforms/Coroutines/CoroSplit.h"
22-
#include "CoroInternal.h"
2322
#include "CoroCloner.h"
23+
#include "CoroInternal.h"
2424
#include "llvm/ADT/DenseMap.h"
2525
#include "llvm/ADT/PriorityWorklist.h"
2626
#include "llvm/ADT/STLExtras.h"
@@ -1092,16 +1092,16 @@ void CoroCloner::create() {
10921092

10931093
void CoroSwitchCloner::create() {
10941094
// Create a new function matching the original type
1095-
NewF = createCloneDeclaration(OrigF, Shape, Suffix,
1096-
OrigF.getParent()->end(), ActiveSuspend);
1095+
NewF = createCloneDeclaration(OrigF, Shape, Suffix, OrigF.getParent()->end(),
1096+
ActiveSuspend);
10971097

10981098
// Clone the function
10991099
CoroCloner::create();
11001100

11011101
// Eliminate coro.free from the clones, replacing it with 'null' in cleanup,
11021102
// to suppress deallocation code.
11031103
coro::replaceCoroFree(cast<CoroIdInst>(VMap[Shape.CoroBegin->getId()]),
1104-
/*Elide=*/FKind == CoroCloner::Kind::SwitchCleanup);
1104+
/*Elide=*/FKind == CoroCloner::Kind::SwitchCleanup);
11051105
}
11061106

11071107
static void updateAsyncFuncPointerContextSize(coro::Shape &Shape) {

0 commit comments

Comments
 (0)