================
@@ -353,6 +353,23 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> 
&B,
   return nullptr;
 }
 
+void CGHLSLRuntime::emitFunctionProlog(const FunctionDecl *FD,
+                                       llvm::Function *Fn) {
+  if (!FD || !Fn)
+    return;
+
+  if (FD->hasAttr<HLSLShaderAttr>()) {
+    emitEntryFunction(FD, Fn);
+  } else {
+    // HLSL functions declared in the current translation unit without
+    // body have external linkage by default.
+    if (!FD->isDefined())
+      Fn->setLinkage(GlobalValue::ExternalLinkage);
+
+    // FIXME: also set external linkage on exported functions
----------------
pow2clk wrote:

I don't know if you want to mention patch constant functions here as well. They 
will need to be external in the end as well. 

https://github.com/llvm/llvm-project/pull/95331
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to