aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2013-04-12 20:17:20 +0000
committerBob Wilson <bob.wilson@apple.com>2013-04-12 20:17:20 +0000
commit1e8058f8d90fab1b9011adf62caa52e19e61382c (patch)
tree78e9563f0f53047fb4cbfa2d121c18574dedb624
parent0c50a032f437544bd6e48e350f5e7b5056662551 (diff)
downloadclang-1e8058f8d90fab1b9011adf62caa52e19e61382c.tar.gz
Define Neon intrinsics as "static inline" to avoid warning. rdar://13108414
We had been defining Neon intrinsics as "static" with always_inline attributes. If you use them from an extern inline function, you get a warning, e.g.: static function 'vadd_u8' is used in an inline function with external linkage This change simply adds the inline keyword to avoid that warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179406 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Sema/arm-neon-types.c12
-rw-r--r--utils/TableGen/NeonEmitter.cpp2
2 files changed, 13 insertions, 1 deletions
diff --git a/test/Sema/arm-neon-types.c b/test/Sema/arm-neon-types.c
index 1a170dbb7e..a49de12d44 100644
--- a/test/Sema/arm-neon-types.c
+++ b/test/Sema/arm-neon-types.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversion -ffreestanding -verify %s
+#ifndef INCLUDE
#include <arm_neon.h>
@@ -33,3 +34,14 @@ int16x8_t test5(int *p) {
void test6(float *p, int32x2_t v) {
return vst1_s32(p, v); // expected-warning {{incompatible pointer types}}
}
+
+#define INCLUDE
+#include "arm-neon-types.c"
+#else
+
+// Make sure we don't get a warning about using a static function in an
+// extern inline function from a header.
+extern inline uint8x8_t test7(uint8x8_t a, uint8x8_t b) {
+ return vadd_u8(a, b);
+}
+#endif
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index d453ededd5..c605859717 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -1342,7 +1342,7 @@ void NeonEmitter::run(raw_ostream &OS) {
}
}
- OS<<"#define __ai static __attribute__((__always_inline__, __nodebug__))\n\n";
+ OS<<"#define __ai static inline __attribute__((__always_inline__, __nodebug__))\n\n";
std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");