[SIL-opaque] Don't override arg value category.

Previously, when emitting block arguments, the value category of the
SILType was overridden to be address for indirect arguments.  With
opaque types, that distinction is made later during AddressLowering.  So
only do that when opaque types are disabled.
This commit is contained in:
Nate Chandler
2022-03-21 16:01:46 -07:00
parent c6de8088c6
commit a532c53cc5
2 changed files with 20 additions and 2 deletions

View File

@@ -78,8 +78,9 @@ public:
SGF.SGM.Types.getLoweredType(t, TypeExpansionContext::minimal());
argType = argType.getCategoryType(argTypeConv.getCategory());
if (isInOut
|| orig.getParameterConvention(SGF.SGM.Types) == AbstractionPattern::Indirect)
if (isInOut || (orig.getParameterConvention(SGF.SGM.Types) ==
AbstractionPattern::Indirect &&
SGF.SGM.M.useLoweredAddresses()))
argType = argType.getCategoryType(SILValueCategory::Address);
// Pop the next parameter info.