[PATCH] D146405: [mlir][Bazel] Avoid __attribute__((weak)) for MSVC.

Adrian Kuegel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 02:10:07 PDT 2023


akuegel updated this revision to Diff 506503.
akuegel added a comment.

Fix comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146405/new/

https://reviews.llvm.org/D146405

Files:
  utils/bazel/llvm-project-overlay/mlir/BUILD.bazel


Index: utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -4101,7 +4101,13 @@
 // Provide a weak registration stub in case the real SerializeToCubin is not
 // linked in.
 
+#if defined(_MSC_VER)
+// This might not work correctly, but it avoids a compilation error because
+// MSVC does not support __attribute__((weak)).
+void mlir::registerGpuSerializeToCubinPass() {}
+#else
 __attribute__((weak)) void mlir::registerGpuSerializeToCubinPass() {}
+#endif
 """,
     ],
 )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146405.506503.patch
Type: text/x-patch
Size: 652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230320/2005c2be/attachment.bin>


More information about the llvm-commits mailing list