[clang] [SystemZ] Add header guard macros to vecintrin.h (PR #129170)

Jonathan Albrecht via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 27 17:33:48 PST 2025


https://github.com/jonathan-albrecht-ibm created https://github.com/llvm/llvm-project/pull/129170

Add header guard macros to clang/lib/Headers/vecintrin.h. Found while compiling the latest numpy with clang 19 on s390x which ends up including vecintrin.h twice. The gcc version of this file has header guards so numpy compiles fine with gcc.

I'd like if this could also make it into a clang 19 release if possible.

@uweigand, could you have a look at this?

>From cc856687f5a61c320b9ee6adf6bd3ede82da8d10 Mon Sep 17 00:00:00 2001
From: Jonathan Albrecht <jonathan.albrecht at ibm.com>
Date: Fri, 21 Feb 2025 15:27:33 -0500
Subject: [PATCH] [SystemZ] Add header guard macros to vecintrin.h

Signed-off-by: Jonathan Albrecht <jonathan.albrecht at ibm.com>
---
 clang/lib/Headers/vecintrin.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/clang/lib/Headers/vecintrin.h b/clang/lib/Headers/vecintrin.h
index a14c39f9f7313..338ea51ce8863 100644
--- a/clang/lib/Headers/vecintrin.h
+++ b/clang/lib/Headers/vecintrin.h
@@ -7,6 +7,9 @@
  *===-----------------------------------------------------------------------===
  */
 
+#ifndef _VECINTRIN_H
+#define _VECINTRIN_H
+
 #if defined(__s390x__) && defined(__VEC__)
 
 #define __ATTRS_ai __attribute__((__always_inline__))
@@ -12861,3 +12864,5 @@ vec_search_string_until_zero_cc(__vector unsigned int __a,
 #error "Use -fzvector to enable vector extensions"
 
 #endif
+
+#endif /* _VECINTRIN_H */



More information about the cfe-commits mailing list