Date: Sat, 19 Nov 2011 17:09:36 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227735 - in head/contrib/llvm/tools/clang: include/clang/Basic lib/Sema Message-ID: <201111191709.pAJH9aXs052722@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sat Nov 19 17:09:36 2011 New Revision: 227735 URL: http://svn.freebsd.org/changeset/base/227735 Log: Pull in r144110 from upstream clang trunk: Mark the overloaded atomic builtins as having custom type checking, which they do. This avoids all of the default argument promotions that we (1) don't want, and (2) undo during that custom type checking, and makes sure that we don't run into trouble during template instantiation. Fixes llvm/clang PR11320. MFC after: 1 week Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:01:11 2011 (r227734) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:09:36 2011 (r227735) @@ -480,111 +480,111 @@ BUILTIN(__builtin_alloca, "v*z" , "n") // FIXME: These assume that char -> i8, short -> i16, int -> i32, // long long -> i64. -BUILTIN(__sync_fetch_and_add, "v.", "") -BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_sub, "v.", "") -BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_or, "v.", "") -BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_and, "v.", "") -BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_xor, "v.", "") -BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "n") - - -BUILTIN(__sync_add_and_fetch, "v.", "") -BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_sub_and_fetch, "v.", "") -BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_or_and_fetch, "v.", "") -BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_and_and_fetch, "v.", "") -BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_xor_and_fetch, "v.", "") -BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_bool_compare_and_swap, "v.", "") -BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "n") -BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "n") -BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "n") -BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "n") -BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "n") - -BUILTIN(__sync_val_compare_and_swap, "v.", "") -BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "n") -BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "n") -BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "n") -BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "n") -BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "n") - -BUILTIN(__sync_lock_test_and_set, "v.", "") -BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "n") -BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "n") -BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "n") -BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_lock_release, "v.", "") -BUILTIN(__sync_lock_release_1, "vcD*.", "n") -BUILTIN(__sync_lock_release_2, "vsD*.", "n") -BUILTIN(__sync_lock_release_4, "viD*.", "n") -BUILTIN(__sync_lock_release_8, "vLLiD*.", "n") -BUILTIN(__sync_lock_release_16, "vLLLiD*.", "n") - -BUILTIN(__sync_swap, "v.", "") -BUILTIN(__sync_swap_1, "ccD*c.", "n") -BUILTIN(__sync_swap_2, "ssD*s.", "n") -BUILTIN(__sync_swap_4, "iiD*i.", "n") -BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "n") +BUILTIN(__sync_fetch_and_add, "v.", "t") +BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "nt") +BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "nt") +BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "nt") +BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "nt") +BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "nt") + +BUILTIN(__sync_fetch_and_sub, "v.", "t") +BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "nt") +BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "nt") +BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "nt") +BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "nt") +BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "nt") + +BUILTIN(__sync_fetch_and_or, "v.", "t") +BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "nt") +BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "nt") +BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "nt") +BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "nt") +BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "nt") + +BUILTIN(__sync_fetch_and_and, "v.", "t") +BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "tn") +BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "tn") +BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "tn") +BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_fetch_and_xor, "v.", "t") +BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "tn") +BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "tn") +BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "tn") +BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "tn") + + +BUILTIN(__sync_add_and_fetch, "v.", "t") +BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_sub_and_fetch, "v.", "t") +BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_or_and_fetch, "v.", "t") +BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_and_and_fetch, "v.", "t") +BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_xor_and_fetch, "v.", "t") +BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_bool_compare_and_swap, "v.", "t") +BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "tn") +BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "tn") +BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "tn") +BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "tn") +BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "tn") + +BUILTIN(__sync_val_compare_and_swap, "v.", "t") +BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "tn") +BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "tn") +BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "tn") +BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "tn") +BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "tn") + +BUILTIN(__sync_lock_test_and_set, "v.", "t") +BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "tn") +BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "tn") +BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "tn") +BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_lock_release, "v.", "t") +BUILTIN(__sync_lock_release_1, "vcD*.", "tn") +BUILTIN(__sync_lock_release_2, "vsD*.", "tn") +BUILTIN(__sync_lock_release_4, "viD*.", "tn") +BUILTIN(__sync_lock_release_8, "vLLiD*.", "tn") +BUILTIN(__sync_lock_release_16, "vLLLiD*.", "tn") + +BUILTIN(__sync_swap, "v.", "t") +BUILTIN(__sync_swap_1, "ccD*c.", "tn") +BUILTIN(__sync_swap_2, "ssD*s.", "tn") +BUILTIN(__sync_swap_4, "iiD*i.", "tn") +BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "tn") BUILTIN(__atomic_load, "v.", "t") BUILTIN(__atomic_store, "v.", "t") Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Sat Nov 19 17:01:11 2011 (r227734) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Sat Nov 19 17:09:36 2011 (r227735) @@ -803,14 +803,6 @@ Sema::SemaBuiltinAtomicOverloaded(ExprRe for (unsigned i = 0; i != NumFixed; ++i) { ExprResult Arg = TheCall->getArg(i+1); - // If the argument is an implicit cast, then there was a promotion due to - // "...", just remove it now. - if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg.get())) { - Arg = ICE->getSubExpr(); - ICE->setSubExpr(0); - TheCall->setArg(i+1, Arg.get()); - } - // GCC does an implicit conversion to the pointer or integer ValType. This // can fail in some cases (1i -> int**), check for this error case now. // Initialize the argument.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111191709.pAJH9aXs052722>