aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 7adc5a4..eff8c9f 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1228,9 +1228,13 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
if (getLangOpts().OpenMP && CurCodeDecl)
CGM.getOpenMPRuntime().emitFunctionProlog(*this, CurCodeDecl);
- // Handle emitting HLSL entry functions.
- if (D && D->hasAttr<HLSLShaderAttr>())
- CGM.getHLSLRuntime().emitEntryFunction(FD, Fn);
+ if (FD && getLangOpts().HLSL) {
+ // Handle emitting HLSL entry functions.
+ if (FD->hasAttr<HLSLShaderAttr>()) {
+ CGM.getHLSLRuntime().emitEntryFunction(FD, Fn);
+ }
+ CGM.getHLSLRuntime().setHLSLFunctionAttributes(FD, Fn);
+ }
EmitFunctionProlog(*CurFnInfo, CurFn, Args);