[llvm] [Offload] Introduce offload-tblgen and initial new API implementation (PR #108413)
    Callum Fare via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Sep 13 08:16:09 PDT 2024
    
    
  
================
@@ -0,0 +1,75 @@
+def : Macro {
+  let name = "OFFLOAD_APICALL";
+  let desc = "Calling convention for all API functions";
+  let condition = "defined(_WIN32)";
+  let value = "__cdecl";
+  let alt_value = "";
+}
+
+def : Macro {
+  let name = "OFFLOAD_APIEXPORT";
+  let desc = "Microsoft-specific dllexport storage-class attribute";
+  let condition = "defined(_WIN32)";
+  let value = "__declspec(dllexport)";
+  let alt_value = "";
+}
+
+def : Macro {
+  let name = "OFFLOAD_DLLEXPORT";
+  let desc = "Microsoft-specific dllexport storage-class attribute";
+  let condition = "defined(_WIN32)";
+  let value = "__declspec(dllexport)";
+}
+
+def : Macro {
+  let name = "OFFLOAD_DLLEXPORT";
+  let desc = "GCC-specific dllexport storage-class attribute";
+  let condition = "__GNUC__ >= 4";
+  let value = "__attribute__ ((visibility (\"default\")))";
+  let alt_value = "";
+}
+
+def : Typedef {
+  let name = "offload_bool_t";
----------------
callumfare wrote:
This is just a copy-paste from UR and a test that the tablegen'd typedefs work. It's not actually used anywhere right now anyway and can be removed and re-added in future - whether it's really needed in practice is a good question.
https://github.com/llvm/llvm-project/pull/108413
    
    
More information about the llvm-commits
mailing list