[Mlir-commits] [mlir] 745a4ca - [mlir] Fix an msvc warning
Benjamin Kramer
llvmlistbot at llvm.org
Sat Jun 18 01:10:44 PDT 2022
Author: Benjamin Kramer
Date: 2022-06-18T10:07:51+02:00
New Revision: 745a4caaebb959a9c075536b8382969a06654bad
URL: https://github.com/llvm/llvm-project/commit/745a4caaebb959a9c075536b8382969a06654bad
DIFF: https://github.com/llvm/llvm-project/commit/745a4caaebb959a9c075536b8382969a06654bad.diff
LOG: [mlir] Fix an msvc warning
Float16bits.cpp(148): warning C4067: unexpected tokens following preprocessor directive - expected a newline
Added:
Modified:
mlir/lib/ExecutionEngine/Float16bits.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/Float16bits.cpp b/mlir/lib/ExecutionEngine/Float16bits.cpp
index 6ee2e41b0497d..289eaeab2ccc0 100644
--- a/mlir/lib/ExecutionEngine/Float16bits.cpp
+++ b/mlir/lib/ExecutionEngine/Float16bits.cpp
@@ -145,9 +145,11 @@ std::ostream &operator<<(std::ostream &os, const bf16 &d) {
// Provide a float->bfloat conversion routine in case the runtime doesn't have
// one.
extern "C" uint16_t
-#if defined(__has_attribute) && __has_attribute(weak) && \
- !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(_WIN32)
+#ifdef __has_attribute
+#if __has_attribute(weak) && !defined(__MINGW32__) && !defined(__CYGWIN__) && \
+ !defined(_WIN32)
__attribute__((__weak__))
+#endif
#endif
__truncsfbf2(float f) {
return float2bfloat(f);
@@ -156,9 +158,11 @@ extern "C" uint16_t
// Provide a double->bfloat conversion routine in case the runtime doesn't have
// one.
extern "C" uint16_t
-#if defined(__has_attribute) && __has_attribute(weak) && \
- !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(_WIN32)
+#ifdef __has_attribute
+#if __has_attribute(weak) && !defined(__MINGW32__) && !defined(__CYGWIN__) && \
+ !defined(_WIN32)
__attribute__((__weak__))
+#endif
#endif
__truncdfbf2(double d) {
// This does a double rounding step, but it's precise enough for our use
More information about the Mlir-commits
mailing list