Skip to content

Commit 155e511

Browse files
committed
Revise comment to be more clear about why ByVal and DeadOnReturn must not be added
1 parent 5791160 commit 155e511

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,8 +2853,8 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
28532853
Attrs.addAttribute(llvm::Attribute::InReg);
28542854

28552855
// HLSL out and inout parameters must not be marked with ByVal or
2856-
// DeadOnReturn attributes, as they would be eliminated by Dead Store
2857-
// Elimination.
2856+
// DeadOnReturn attributes because stores to these parameters are visible
2857+
// to the caller.
28582858
if (auto ParamABI = FI.getExtParameterInfo(ArgNo).getABI();
28592859
ParamABI != ParameterABI::HLSLOut &&
28602860
ParamABI != ParameterABI::HLSLInOut) {

0 commit comments

Comments
 (0)