Skip to content

Commit 35e639f

Browse files
committed
[Distributed] IRGen: Don't use designated initializers to create ArgumentDecoderInfo
1 parent c3cafcc commit 35e639f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

lib/IRGen/GenDistributed.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ namespace {
7070
struct ArgumentDecoderInfo {
7171
llvm::Value *Decoder;
7272

73-
struct {
74-
CanSILFunctionType Type;
75-
FunctionPointer Fn;
76-
} DecodeMethod;
73+
CanSILFunctionType MethodType;
74+
FunctionPointer MethodPtr;
7775

78-
CanSILFunctionType getMethodType() const { return DecodeMethod.Type; }
76+
ArgumentDecoderInfo(llvm::Value *decoder, CanSILFunctionType decodeMethodTy,
77+
FunctionPointer decodePtr)
78+
: Decoder(decoder), MethodType(decodeMethodTy), MethodPtr(decodePtr) {}
79+
80+
CanSILFunctionType getMethodType() const { return MethodType; }
7981

8082
/// Form a callee to a decode method - `decodeNextArgument`.
8183
Callee getCallee() const;
@@ -109,8 +111,6 @@ class DistributedAccessor {
109111
/// Load an argument value from the given decoder \c decoder
110112
/// to the given explosion \c arguments. Information describing
111113
/// the type of argument comes from runtime metadata.
112-
///
113-
/// Returns a pair of aligned offset and value size.
114114
void decodeArgument(unsigned argumentIdx, const ArgumentDecoderInfo &decoder,
115115
llvm::Value *argumentType, const SILParameterInfo &param,
116116
Explosion &arguments);
@@ -657,8 +657,7 @@ DistributedAccessor::findArgumentDecoder(llvm::Value *decoder) {
657657
classifyFunctionPointerKind(decodeSIL), fnPtr,
658658
/*secondaryValue=*/nullptr, signature);
659659

660-
return {.Decoder = decoder,
661-
.DecodeMethod = {.Type = methodTy, .Fn = methodPtr}};
660+
return {decoder, methodTy, methodPtr};
662661
}
663662

664663
auto selfTy = methodTy->getSelfParameter().getSILStorageType(
@@ -670,8 +669,7 @@ DistributedAccessor::findArgumentDecoder(llvm::Value *decoder) {
670669
auto methodPtr =
671670
emitVirtualMethodValue(IGF, metadata, SILDeclRef(decodeFn), methodTy);
672671

673-
return {.Decoder = decoder,
674-
.DecodeMethod = {.Type = methodTy, .Fn = methodPtr}};
672+
return {decoder, methodTy, methodPtr};
675673
}
676674

677675
SILType DistributedAccessor::getResultType() const {
@@ -685,6 +683,6 @@ SILType DistributedAccessor::getErrorType() const {
685683
}
686684

687685
Callee ArgumentDecoderInfo::getCallee() const {
688-
CalleeInfo info(DecodeMethod.Type, DecodeMethod.Type, SubstitutionMap());
689-
return {std::move(info), DecodeMethod.Fn, Decoder};
686+
CalleeInfo info(MethodType, MethodType, SubstitutionMap());
687+
return {std::move(info), MethodPtr, Decoder};
690688
}

0 commit comments

Comments
 (0)