Skip to content

Commit 58577d2

Browse files
spallllvm-beanz
andauthored
Update clang/lib/CodeGen/CGCall.cpp
Update comment with suggested change. Co-authored-by: Chris B <[email protected]>
1 parent b663f00 commit 58577d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5325,8 +5325,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
53255325
break;
53265326
}
53275327
} else if (I->getType()->isArrayParameterType()) {
5328-
// use the tmp created by the HLSLOutArgExpr
5329-
// instead of creating a new one below and copying the tmp into it.
5328+
// Don't produce a temporary for ArrayParameterType arguments.
5329+
// ArrayParameterType arguments are only created from
5330+
// HLSL_ArrayRValue casts and HLSLOutArgExpr expressions, both
5331+
// of which create temporaries already. This allows us to just use the
5332+
// scalar for the decayed array pointer as the argument directly.
53305333
IRCallArgs[FirstIRArg] = I->getKnownRValue().getScalarVal();
53315334
break;
53325335
}

0 commit comments

Comments
 (0)