aaron.ballman added inline comments.
================ Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:94 llvm::Function *F, const FunctionDecl *FD) { - if (HLSLShaderAttr *ShaderAttr = FD->getAttr<HLSLShaderAttr>()) { - const StringRef ShaderAttrKindStr = "dx.shader"; - F->addFnAttr(ShaderAttrKindStr, - ShaderAttr->ConvertShaderTypeToStr(ShaderAttr->getType())); + HLSLShaderAttr *ShaderAttr = FD->getAttr<HLSLShaderAttr>(); + assert(ShaderAttr && "All entry functions must have a HLSLShaderAttr"); ---------------- ================ Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:107-108 + CGM.getIntrinsic(Intrinsic::dx_flattened_thread_id_in_group); + CallInst *CI = B.CreateCall(FunctionCallee(DxGroupIndex)); + return CI; + } ---------------- ================ Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:122-141 + // Copy function attributes over, we have no argument or return attributes + // that can be valid on the real entry + AttributeList NewAttrs = AttributeList::get(Ctx, AttributeList::FunctionIndex, + Fn->getAttributes().getFnAttrs()); + EntryFn->setAttributes(NewAttrs); + setHLSLEntryAttributes(EntryFn, FD); + ---------------- ================ Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:135 + llvm::SmallVector<Value *> Args; + for (const auto Param : FD->parameters()) { + Args.push_back(emitInputSemantic(B, *Param)); ---------------- ================ Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:55 - void setHLSLFunctionAttributes(llvm::Function *, const FunctionDecl *); + void setHLSLEntryAttributes(llvm::Function *, const FunctionDecl *); + ---------------- These parameters should have names so people don't think the parameters aren't used. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131203/new/ https://reviews.llvm.org/D131203 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits