diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-13 18:34:17 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-13 18:34:17 +0000 |
commit | ad24ad4c741cad0fe79d6e4a74edc58d592a0f90 (patch) | |
tree | ca614c5e0febb00059e1d5e98c3cf7a866928a2f /include | |
parent | 7b7db26d78509c0692d0000bbed1b0cf5e18ece8 (diff) | |
download | clang-ad24ad4c741cad0fe79d6e4a74edc58d592a0f90.tar.gz |
Allow clang to build __clear_cache on ARM.
__clear_cache is special. It needs no signature, but is a real function in
compiler_rt or libgcc.
Patch by Andrew Turner.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/Builtins.def | 2 | ||||
-rw-r--r-- | include/clang/Basic/Builtins.h | 7 | ||||
-rw-r--r-- | include/clang/Basic/BuiltinsAArch64.def | 2 | ||||
-rw-r--r-- | include/clang/Basic/BuiltinsARM.def | 2 |
4 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 247ffde019..3dd25b4ebf 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -70,6 +70,8 @@ // f -> this is a libc/libm function without the '__builtin_' prefix. It can // be followed by ':headername:' to state which header this function // comes from. +// i -> this is a runtime library implemented function without the +// '__builtin_' prefix. It will be implemented in compiter-rt or libgcc. // p:N: -> this is a printf-like function whose Nth argument is the format // string. // P:N: -> similar to the p:N: attribute, but the function is like vprintf diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 77c0461f10..eb156519ae 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -130,6 +130,13 @@ public: return strchr(GetRecord(ID).Attributes, 'f') != 0; } + /// \brief Determines whether this builtin is a predefined compiler-rt/libgcc + /// function, such as "__clear_cache", where we know the signature a + /// priori. + bool isPredefinedRuntimeFunction(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'i') != 0; + } + /// \brief Determines whether this builtin has custom typechecking. bool hasCustomTypechecking(unsigned ID) const { return strchr(GetRecord(ID).Attributes, 't') != 0; diff --git a/include/clang/Basic/BuiltinsAArch64.def b/include/clang/Basic/BuiltinsAArch64.def index 9e9f6d0875..768e4bb26c 100644 --- a/include/clang/Basic/BuiltinsAArch64.def +++ b/include/clang/Basic/BuiltinsAArch64.def @@ -15,4 +15,4 @@ // The format of this database matches clang/Basic/Builtins.def. // In libgcc -BUILTIN(__clear_cache, "vv*v*", "") +BUILTIN(__clear_cache, "vv*v*", "i") diff --git a/include/clang/Basic/BuiltinsARM.def b/include/clang/Basic/BuiltinsARM.def index fad9007e04..2f2993fc6a 100644 --- a/include/clang/Basic/BuiltinsARM.def +++ b/include/clang/Basic/BuiltinsARM.def @@ -15,7 +15,7 @@ // The format of this database matches clang/Basic/Builtins.def. // In libgcc -BUILTIN(__clear_cache, "vv*v*", "") +BUILTIN(__clear_cache, "vv*v*", "i") BUILTIN(__builtin_thread_pointer, "v*", "") // Saturating arithmetic |