Re: [PATCH] Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false; '

2015-05-24 Thread Richard
When the replacement text is already a negated rexpression, `!expr`, and we're negating it again, use `expr`, not `!!expr` as the replacement. http://reviews.llvm.org/D9810 Files: clang-tidy/readability/SimplifyBooleanExprCheck.cpp clang-tidy/readability/SimplifyBooleanExprCheck.h test/cl

[PATCH] [Concepts] Add (disabled) __has_feature/extension; NFC

2015-05-24 Thread Hubert Tong
Hi rsmith, faisalv, fraggamuffin, This adds a commented-out line which would otherwise enable `__has_feature` and `__has_extension` queries for the Concepts TS and an equally commented-out section on the Clang Language Extensions page. http://reviews.llvm.org/D9964 Files: docs/LanguageExtensio

Re: [PATCH] Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false; '

2015-05-24 Thread Richard
In http://reviews.llvm.org/D9810#174289, @LegalizeAdulthood wrote: > In http://reviews.llvm.org/D9810#174276, @LegalizeAdulthood wrote: > > > It all compiles, but manual testing with clang-query shows the problem. > > See https://llvm.org/bugs/show_bug.cgi?id=23552 for details. > > > There's als

Re: [PATCH] Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false; '

2015-05-24 Thread Richard
After sorting out some things with the clang tree for testing, I discovered that the code had errors. This diff corrects them. Specifically `compoundStmt(hasAnySubstatement(ifStmt()))` will always match the first `if` statement in a compound statement. The matcher will not be invoked for each

Re: [PATCH] libunwind: Fix unw_step() for ARM EHABI.

2015-05-24 Thread Renato Golin
Hi Logan, I imagine this is the result of our discussion on how to merge the two exception handling mechanisms. It's been a long while since the last time I checked the unwinder code, so I'm not going to opine on it, but if both you and Anton are happy with it, so am I. cheers, --renato http

Re: [PATCH] libcxx: Switch to use __gnu_unwind_frame() for libunwind.

2015-05-24 Thread Renato Golin
And I imagine that this will also fix the problem we had earlier with undefined __gnu_unwind_frame, right? If that's so, this one also looks good to me. Thanks for the work! --renato http://reviews.llvm.org/D9962 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/

[PATCH] libcxx: Switch to use __gnu_unwind_frame() for libunwind.

2015-05-24 Thread Logan Chien
Hi asl, rengolin, danalbert, compnerd, joerg, As a step to fix libunwind unw_step(), a new function __gnu_unwind_frame() has been introduced to libunwind, and it is required to use this function so that some libunwind internal data structure can be updated properly. Depends On: D9961 http://revi

[PATCH] libunwind: Fix unw_step() for ARM EHABI.

2015-05-24 Thread Logan Chien
Hi asl, rengolin, danalbert, compnerd, This commit fixes the unw_step() for ARM EHABI. However, this commit also changes the implementation details for ARM EHABI. The first change is that the personality function should call __gnu_unwind_frame() for default (or de facto) frame unwinding based on

Re: [PATCH] Check for null pointers given to memcpy with ubsan

2015-05-24 Thread Richard Smith
I agree that we should be respecting the `__attribute__((nonnull))` on these functions whether or not we emit them as builtin calls; as such, it makes sense to me for this to be under `-fsanitize=nonnull-attribute`. A couple of minor copy-paste issues and then this looks fine to me, but please w

Re: [PATCH] Check for null pointers given to memcpy with ubsan

2015-05-24 Thread Nuno Lopes
On 24 May 2015 4:57 pm, "Nuno Lopes" wrote: In http://reviews.llvm.org/D9673#170543, @samsonov wrote: > In http://reviews.llvm.org/D9673#170474, @nlopes wrote: > > > > Wait a second, won't UBSan handle this automatically if > > > memcpy/memmove are > > > > > declared with __attribute__((non

Re: [PATCH] Fixed debug info generation for function static variables, typedef, and records

2015-05-24 Thread Amjad Aboud
Made some changes to follow Paul's review: Added another test for static variables, based on the example from Bug 19238. Moved some common code to a new helper function. http://reviews.llvm.org/D9760 Files: lib/CodeGen/CGDebugInfo.cpp lib/CodeGen/CGDebugInfo.h lib/CodeGen/CGDecl.cpp test

Re: [PATCH] Check for null pointers given to memcpy with ubsan

2015-05-24 Thread Richard Smith
On 24 May 2015 4:57 pm, "Nuno Lopes" wrote: > > In http://reviews.llvm.org/D9673#170543, @samsonov wrote: > > > In http://reviews.llvm.org/D9673#170474, @nlopes wrote: > > > > > > Wait a second, won't UBSan handle this automatically if memcpy/memmove are > > > > > > > declared with __attribute__(

Re: [PATCH] Check for null pointers given to memcpy with ubsan

2015-05-24 Thread Nuno Lopes
In http://reviews.llvm.org/D9673#170543, @samsonov wrote: > In http://reviews.llvm.org/D9673#170474, @nlopes wrote: > > > > Wait a second, won't UBSan handle this automatically if memcpy/memmove > > > are > > > > > declared with __attribute__((nonnull)) in the header? Otherwise, is > > > there

Re: [PATCH] Check for null pointers given to memcpy with ubsan

2015-05-24 Thread Nuno Lopes
REPOSITORY rL LLVM http://reviews.llvm.org/D9673 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ ___ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

[PATCH] [clang-tidy] Fix for llvm.org/PR23355

2015-05-24 Thread Szabolcs Sipos
Hi alexfh, misc-static-assert now recognizes __builtin_expect based assert macros. I also added __builtin_expect to the white list of misc-assert-side-effect. http://reviews.llvm.org/D9959 Files: clang-tidy/misc/AssertSideEffectCheck.cpp clang-tidy/misc/StaticAssertCheck.cpp test/clang-ti