[clang] [HLSL] Change default linkage of HLSL functions and groupshared variables (v2) (PR #95331)

Xiang Li via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 10:28:30 PDT 2024


================
@@ -1223,9 +1223,10 @@ 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);
+  // Emit HLSL specific initialization
+  if (getLangOpts().HLSL) {
+    CGM.getHLSLRuntime().emitFunctionProlog(FD, Fn);
+  }
----------------
python3kgae wrote:

```suggestion
  if (getLangOpts().HLSL)
    CGM.getHLSLRuntime().emitFunctionProlog(FD, Fn);
```

https://github.com/llvm/llvm-project/pull/95331


More information about the cfe-commits mailing list