svn commit: r229039 - in stable/9/contrib/llvm/tools/clang: include/clang/Basic lib/Sema

Dimitry Andric dim at FreeBSD.org
Fri Dec 30 22:17:11 UTC 2011


Author: dim
Date: Fri Dec 30 22:17:10 2011
New Revision: 229039
URL: http://svn.freebsd.org/changeset/base/229039

Log:
  MFC r227735:
  
  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.

Modified:
  stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
  stable/9/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
Directory Properties:
  stable/9/contrib/llvm/   (props changed)
  stable/9/contrib/llvm/tools/clang/   (props changed)

Modified: stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
==============================================================================
--- stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def	Fri Dec 30 22:07:15 2011	(r229038)
+++ stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def	Fri Dec 30 22:17:10 2011	(r229039)
@@ -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: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
==============================================================================
--- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp	Fri Dec 30 22:07:15 2011	(r229038)
+++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp	Fri Dec 30 22:17:10 2011	(r229039)
@@ -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.


More information about the svn-src-stable-9 mailing list