From owner-svn-src-head@FreeBSD.ORG Sat Jun 15 12:13:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34C5194D; Sat, 15 Jun 2013 12:13:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26CC415DA; Sat, 15 Jun 2013 12:13:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5FCDN9u062862; Sat, 15 Jun 2013 12:13:23 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5FCDMkl062856; Sat, 15 Jun 2013 12:13:22 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201306151213.r5FCDMkl062856@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Jun 2013 12:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251790 - in head/contrib/llvm/tools/clang: include/clang/Basic lib/Sema X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jun 2013 12:13:24 -0000 Author: andrew Date: Sat Jun 15 12:13:22 2013 New Revision: 251790 URL: http://svnweb.freebsd.org/changeset/base/251790 Log: Pull in r183926 from LLVM trunk: 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. This allows us to build the __clear_cache function in compiler-rt. Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Jun 15 10:38:31 2013 (r251789) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Jun 15 12:13:22 2013 (r251790) @@ -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 Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h Sat Jun 15 10:38:31 2013 (r251789) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h Sat Jun 15 12:13:22 2013 (r251790) @@ -128,6 +128,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; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def Sat Jun 15 10:38:31 2013 (r251789) +++ head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def Sat Jun 15 12:13:22 2013 (r251790) @@ -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") Modified: head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def Sat Jun 15 10:38:31 2013 (r251789) +++ head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def Sat Jun 15 12:13:22 2013 (r251790) @@ -15,7 +15,7 @@ // The format of this database matches clang/Basic/Builtins.def. // In libgcc -BUILTIN(__clear_cache, "v.", "") +BUILTIN(__clear_cache, "v.", "i") BUILTIN(__builtin_thread_pointer, "v*", "") // Saturating arithmetic Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Jun 15 10:38:31 2013 (r251789) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Jun 15 12:13:22 2013 (r251790) @@ -8671,7 +8671,8 @@ Decl *Sema::ActOnStartOfFunctionDef(Scop // Builtin functions cannot be defined. if (unsigned BuiltinID = FD->getBuiltinID()) { - if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) { + if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID) && + !Context.BuiltinInfo.isPredefinedRuntimeFunction(BuiltinID)) { Diag(FD->getLocation(), diag::err_builtin_definition) << FD; FD->setInvalidDecl(); }