================ @@ -1239,9 +1239,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, if (getLangOpts().OpenMP && CurCodeDecl) CGM.getOpenMPRuntime().emitFunctionProlog(*this, CurCodeDecl); - if (FD && getLangOpts().HLSL) { + if (getLangOpts().HLSL) { // Handle emitting HLSL entry functions. - if (FD->hasAttr<HLSLShaderAttr>()) { + if (FD && FD->hasAttr<HLSLShaderAttr>()) { CGM.getHLSLRuntime().emitEntryFunction(FD, Fn); } CGM.getHLSLRuntime().setHLSLFunctionAttributes(FD, Fn); ---------------- pow2clk wrote:
Yeah, the `emitFunctionProlog` form is how it looked in an earlier version of a change Helena made. I think it was #102275 which introduced `setHLSLFucntionAttributes`. I decided to follow her lead, but I don't know the reasoning behind it. This becomes moot with the new approach I'm taking. https://github.com/llvm/llvm-project/pull/106588 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits