================
@@ -976,17 +977,21 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl
*FD,
PD->getAttr<HLSLParamModifierAttr>()) {
llvm_unreachable("Not handled yet");
} else {
- llvm::Type *ParamType =
- Param.hasByValAttr() ? Param.getParamByValType() : Param.getType();
+ llvm::Type *ParamType = Param.hasByValAttr() ? Param.getParamByValType()
+ : PD->getType()->isRecordType()
+ ? CGM.getTypes().ConvertType(PD->getType())
+ : Param.getType();
auto AttrBegin = PD->specific_attr_begin<HLSLAppliedSemanticAttr>();
auto AttrEnd = PD->specific_attr_end<HLSLAppliedSemanticAttr>();
auto Result =
handleSemanticLoad(B, FD, ParamType, PD, AttrBegin, AttrEnd);
SemanticValue = Result.first;
if (!SemanticValue)
return;
- if (Param.hasByValAttr()) {
- llvm::Value *Var = B.CreateAlloca(Param.getParamByValType());
+ // if this is a ptr to a record and it does'nt have byval attr
+ // we still need the record type not just 'ptr'
----------------
hekota wrote:
Nit - typo, and all comments should be full sentences. Applies to other
comments in this PR as well.
```suggestion
// If this is a 'ptr' to a record and it doesn't have byval attribute,
// we still need the record type, not just 'ptr'.
```
https://github.com/llvm/llvm-project/pull/190089
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits