[libc-commits] [PATCH] D123539: [libc] Fix nested namespace issues with multiply_add.h due to including FMA header inside namespaces.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 11 13:00:46 PDT 2022


lntue created this revision.
lntue added reviewers: michaelrj, sivachandra.
Herald added subscribers: ecnelises, tschuett.
Herald added projects: libc-project, All.
lntue requested review of this revision.

Fix nested namespace issues with multiply_add.h due to including FMA header inside namespaces.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123539

Files:
  libc/src/__support/FPUtil/multiply_add.h


Index: libc/src/__support/FPUtil/multiply_add.h
===================================================================
--- libc/src/__support/FPUtil/multiply_add.h
+++ libc/src/__support/FPUtil/multiply_add.h
@@ -22,10 +22,17 @@
   return x * y + z;
 }
 
+} // namespace fputil
+} // namespace __llvm_libc
+
 #if defined(LIBC_TARGET_HAS_FMA)
+
 // FMA instructions are available.
 #include "FMA.h"
 
+namespace __llvm_libc {
+namespace fputil {
+
 template <> inline float multiply_add<float>(float x, float y, float z) {
   return fma(x, y, z);
 }
@@ -33,9 +40,10 @@
 template <> inline double multiply_add<double>(double x, double y, double z) {
   return fma(x, y, z);
 }
-#endif // LIBC_TARGET_HAS_FMA
 
 } // namespace fputil
 } // namespace __llvm_libc
 
+#endif // LIBC_TARGET_HAS_FMA
+
 #endif // LLVM_LIBC_SRC_SUPPORT_FPUTIL_MULTIPLY_ADD_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123539.422015.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220411/881ea593/attachment.bin>


More information about the libc-commits mailing list