]> granicus.if.org Git - clang/commitdiff
Really fix the declaration of __clear_cache.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 14 May 2013 18:06:10 +0000 (18:06 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 14 May 2013 18:06:10 +0000 (18:06 +0000)
When I tested gcc's behaviour before, I forgot the extern "C", so it
would warn when the types *did* match.

So in the end
* __clear_cache takes two void pointers.
* aarch64 was correct before.
* libgcc's manual is wrong.
* this patch fixes arm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181810 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsAArch64.def
include/clang/Basic/BuiltinsARM.def
test/Sema/builtins-aarch64.c
test/Sema/builtins-arm.c

index 939c080cc50eff02483ffa7e0a770472f2b138c0..9e9f6d0875dbfcd8a5db1fcc881f2d45bd997b3a 100644 (file)
@@ -15,4 +15,4 @@
 // The format of this database matches clang/Basic/Builtins.def.
 
 // In libgcc
-BUILTIN(__clear_cache, "vc*c*", "")
+BUILTIN(__clear_cache, "vv*v*", "")
index 3dbeb0b0aea08f85fc7d98dfe85133f86429d130..fad9007e04b81ae044df955a629eefa581e2d22f 100644 (file)
@@ -15,7 +15,7 @@
 // The format of this database matches clang/Basic/Builtins.def.
 
 // In libgcc
-BUILTIN(__clear_cache, "vc*c*", "")
+BUILTIN(__clear_cache, "vv*v*", "")
 BUILTIN(__builtin_thread_pointer, "v*", "")
 
 // Saturating arithmetic
index cc2a1549f78f553eeb93b6b42a15f8cdd8499553..b0557532fab64a86b50a95fc4615f5e7c22fe2a9 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -DTEST1 -fsyntax-only -verify %s
 
 #ifdef TEST1
-void __clear_cache(char *start, char *end);
+void __clear_cache(void *start, void *end);
 #endif
 
 void test_clear_cache_chars(char *start, char *end) {
index b516040f64e4e02730265db54f0025d43c43de96..3ac1da0aa93d6c7c4a84e4d0db6e3a526bc63e17 100644 (file)
@@ -2,14 +2,14 @@
 // RUN: %clang_cc1 -triple armv7 -target-abi apcs-gnu \
 // RUN:   -fsyntax-only -verify %s
 
-void f(char *a, char *b) {
-  __clear_cache(); // expected-error {{too few arguments to function call, expected 2, have 0}} // expected-note {{'__clear_cache' is a builtin with type 'void (char *, char *)}}
+void f(void *a, void *b) {
+  __clear_cache(); // expected-error {{too few arguments to function call, expected 2, have 0}} // expected-note {{'__clear_cache' is a builtin with type 'void (void *, void *)}}
   __clear_cache(a); // expected-error {{too few arguments to function call, expected 2, have 1}}
   __clear_cache(a, b);
 }
 
-void __clear_cache(void*, void*); // expected-error {{conflicting types for '__clear_cache'}}
-void __clear_cache(char*, char*);
+void __clear_cache(char*, char*); // expected-error {{conflicting types for '__clear_cache'}}
+void __clear_cache(void*, void*);
 
 #if defined(__ARM_PCS) || defined(__ARM_EABI__)
 // va_list on ARM AAPCS is struct { void* __ap }.