Re: [PATCH] D21667: [analyzer] Add rudimentary handling of AtomicExpr.

2016-06-24 Thread Noel Grandin via cfe-commits
grandinj added a subscriber: grandinj.


Comment at: test/Analysis/atomics.c:4
@@ +3,3 @@
+// Tests for c11 atomics. Many of these tests currently yield unknown
+// because we don't folly model the atomics and instead imprecisely
+// treat their arguments as escaping.

folly->fully


http://reviews.llvm.org/D21667



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21673: [libcxx] guard throw with exception enabling check

2016-06-24 Thread Noel Grandin via cfe-commits
grandinj added a subscriber: grandinj.


Comment at: include/experimental/optional:524
@@ -521,1 +523,3 @@
+assert(!"bad optional access");
+#endif
 return this->__val_;

If this kind of code is going to show up in lots of places, then maybe wrap it 
up in a macro:

   _LIBCPP_THROW_OR_ASSERT(bad_optional_access(), "bad optional access")

?

With some extra preprocessor magic, and if LLVM didn't care about the string in 
the assert, could even leave out the second parameter


http://reviews.llvm.org/D21673



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21706: [libcxx] refactor for throw

2016-07-01 Thread Noel Grandin via cfe-commits
grandinj added inline comments.


Comment at: include/array:209
@@ -211,7 +208,3 @@
 if (__n >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
-throw out_of_range("array::at");
-#else
-assert(!"array::at out_of_range");
-#endif
+__libcpp_throw(out_of_range("array::at"));
 return __elems_[__n];

the error message of the assert was perhaps better?


Comment at: include/array:219
@@ -225,7 +218,3 @@
 if (__n >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
-throw out_of_range("array::at");
-#else
-assert(!"array::at out_of_range");
-#endif
+__libcpp_throw(out_of_range("array::at"));
 return __elems_[__n];

the error message of the assert was perhaps better?


Comment at: include/experimental/dynarray:279
@@ -286,7 +278,3 @@
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
-throw out_of_range("dynarray::at");
-#else
-assert(!"dynarray::at out_of_range");
-#endif
+__libcpp_throw(out_of_range("dynarray::at"));
 }

the error message of the assert was perhaps better?


Comment at: include/experimental/dynarray:291
@@ -302,7 +290,3 @@
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
-throw out_of_range("dynarray::at");
-#else
-assert(!"dynarray::at out_of_range");
-#endif
+__libcpp_throw(out_of_range("dynarray::at"));
 }

ditto


Comment at: include/map:1446
@@ -1446,4 +1445,3 @@
 if (__child == nullptr)
-throw out_of_range("map::at:  key not found");
-#endif  // _LIBCPP_NO_EXCEPTIONS
+__libcpp_throw(out_of_range("map::at:  key not found"));
 return static_cast<__node_pointer>(__child)->__value_.__cc.second;

looks like extra spaces in this message (which was there in the original, I 
know)


Comment at: include/map:1457
@@ -1459,4 +1456,3 @@
 if (__child == nullptr)
-throw out_of_range("map::at:  key not found");
-#endif  // _LIBCPP_NO_EXCEPTIONS
+__libcpp_throw(out_of_range("map::at:  key not found"));
 return static_cast<__node_pointer>(__child)->__value_.__cc.second;

extra spaces here too


http://reviews.llvm.org/D21706



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits