[PATCH] D39412: [Driver] Give LIBRARY_PATH precedence over native toolchains

2017-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. Herald added subscribers: aheejin, jgravelle-google, sbc100, nhaehnle, dschuff, jfb, emaste. `LIBRARY_PATH` expansion should happen before expanding native toolchains' linker arguments, if any, to allow overriding the default standard libraries to link. GCC

[PATCH] D39374: CodeGen: Fix insertion position of addrspace cast for alloca

2017-10-30 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Ok. https://reviews.llvm.org/D39374 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39008: [CodeGen] Propagate may-alias'ness of lvalues with TBAA info

2017-10-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Looks good, but you missed updating equality/hashing for the new Kind field. Comment at: lib/CodeGen/CodeGenTBAA.h:71 AccessType == Other.AccessType && Offset == Other.Offset; } This needs to factor in the

[PATCH] D39177: [CodeGen] Generate TBAA info for reference loads

2017-10-30 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Looks good; sorry for not catching that, either. https://reviews.llvm.org/D39177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39372: Make DiagnosticIDs::getAllDiagnostics static.

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I like the idea of making functions that can be static, static. Could you update the usages of this function as well? https://reviews.llvm.org/D39372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

r316886 - Add missing expected-no-diagnostics comment to test.

2017-10-30 Thread Gabor Horvath via cfe-commits
Author: xazax Date: Mon Oct 30 02:01:48 2017 New Revision: 316886 URL: http://llvm.org/viewvc/llvm-project?rev=316886=rev Log: Add missing expected-no-diagnostics comment to test. Modified: cfe/trunk/test/Analysis/block-in-critical-section.m Modified:

r316892 - [analyzer] lock_guard and unique_lock extension for BlockInCriticalSection checker

2017-10-30 Thread Gabor Horvath via cfe-commits
Author: xazax Date: Mon Oct 30 03:09:55 2017 New Revision: 316892 URL: http://llvm.org/viewvc/llvm-project?rev=316892=rev Log: [analyzer] lock_guard and unique_lock extension for BlockInCriticalSection checker A patch by zdtorok (Zoltán Dániel Török)! Differential Revision:

[PATCH] D38110: [libunwind][MIPS]: Add support for unwinding in O32 and N64 processes.

2017-10-30 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Just a heads up WRT this patch; we're discussing changing the size of `unw_word_t` to match `uintptr_t` in https://reviews.llvm.org/D39365. Does that break anything for your case? It shouldn't affect what's stored in the Register class, only pointers in the

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Yay. Thanks Gabor, i didn't think about it but it look very nice to have such matcher. I think the matcher shouldn't be checker-local, but shared into `ASTMatchers.h` all other matchers - not only this matcher is universally useful, but also i have weird vague memories

[PATCH] D38844: [analyzer] Make issue hash related tests more concise

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Great stuff! Comment at: lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp:84 ::analyzerNumTimesReached) +.Case("clang_analyzer_hashDump", ::analyzerDumpHash)

[PATCH] D38110: [libunwind][MIPS]: Add support for unwinding in O32 and N64 processes.

2017-10-30 Thread John Baldwin via Phabricator via cfe-commits
bsdjhb added a comment. In https://reviews.llvm.org/D38110#910526, @mstorsjo wrote: > Just a heads up WRT this patch; we're discussing changing the size of > `unw_word_t` to match `uintptr_t` in https://reviews.llvm.org/D39365. Does > that break anything for your case? It shouldn't affect

[PATCH] D39332: [clang-refactor] Introduce "local-qualified-rename" action.

2017-10-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:154 + +class LocalQualifiedRename final : public RefactoringAction { +public: ioeric wrote: > arphaman wrote: > > ioeric wrote: >

r316895 - [refactor] Fix a clang-tidy warning.

2017-10-30 Thread Haojian Wu via cfe-commits
Author: hokein Date: Mon Oct 30 04:17:09 2017 New Revision: 316895 URL: http://llvm.org/viewvc/llvm-project?rev=316895=rev Log: [refactor] Fix a clang-tidy warning. NFC Modified: cfe/trunk/lib/Tooling/Refactoring/Rename/RenamingAction.cpp Modified:

[PATCH] D38801: [analyzer] In getSVal() API, disable auto-detection of void type as char type.

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Yeah, cleaning up this API would be great - as long as everybody loves to have the API broken and rewrite stuff. If we are to simplify some APIs, i'd definitely start with `getAsSymExpr()`/`getAsSymbol()`/`getAsSymbolicExpression()`. Essentially we only need `getSVal(MR)`

r316896 - [CodeGen] Generate TBAA info for reference loads

2017-10-30 Thread Ivan A. Kosarev via cfe-commits
Author: kosarev Date: Mon Oct 30 04:49:31 2017 New Revision: 316896 URL: http://llvm.org/viewvc/llvm-project?rev=316896=rev Log: [CodeGen] Generate TBAA info for reference loads Differential Revision: https://reviews.llvm.org/D39177 Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp

[PATCH] D39177: [CodeGen] Generate TBAA info for reference loads

2017-10-30 Thread Ivan Kosarev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316896: [CodeGen] Generate TBAA info for reference loads (authored by kosarev). Changed prior to commit: https://reviews.llvm.org/D39177?vs=120654=120800#toc Repository: rL LLVM

[PATCH] D39332: [clang-refactor] Introduce "local-qualified-rename" action.

2017-10-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 120792. hokein added a comment. - rebase to master - move the implementation to a refactoring rule in `local-rename` - support non-selection based refactoring action invocation call path https://reviews.llvm.org/D39332 Files:

[PATCH] D38801: [analyzer] In getSVal() API, disable auto-detection of void type as char type.

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. I like the idea of making `ProgramState::getSVal(const MemRegion *)` symmetric to `ProgramState::getSVal(Loc)`. Just some philosophical questions which should probably be addressed in the future: But also I wonder, should we maintain all these overloads? I mean, a

[PATCH] D38110: [libunwind][MIPS]: Add support for unwinding in O32 and N64 processes.

2017-10-30 Thread John Baldwin via Phabricator via cfe-commits
bsdjhb updated this revision to Diff 120798. bsdjhb marked an inline comment as done. bsdjhb added a comment. - Rebase on more MAX_REGISTER changes. - Use macro for lastDwarfRegisterNumber. - Move MIPS ABI constants under a single #ifdef __mips__. https://reviews.llvm.org/D38110 Files:

r316900 - [analyzer] Use the signature of the primary template for issue hash calculation

2017-10-30 Thread Gabor Horvath via cfe-commits
Author: xazax Date: Mon Oct 30 05:16:07 2017 New Revision: 316900 URL: http://llvm.org/viewvc/llvm-project?rev=316900=rev Log: [analyzer] Use the signature of the primary template for issue hash calculation Now when a template is instantiated more times and there is a bug found in the

[PATCH] D38728: [analyzer] Use the signature of the primary template for issue hash calculation

2017-10-30 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316900: [analyzer] Use the signature of the primary template for issue hash calculation (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D38728?vs=118788=120804#toc Repository:

[PATCH] D39365: [libunwind] Change unw_word_t to always have the same size as the pointer size

2017-10-30 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D39365#910590, @theraven wrote: > This makes things worse for us. On CHERI, `[u]intptr_t` is a (`typedef` for > a) built-in type that can hold a capability. Having `unw_word_t` be > `uintptr_t` For understanding, I guess you meant

[PATCH] D39419: Fix crash when parsing objective-c++ containing invalid lambda

2017-10-30 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple created this revision. https://reviews.llvm.org/D39419 Files: lib/Parse/ParseExprCXX.cpp test/Parser/objcxx11-invalid-lambda.cpp Index: test/Parser/objcxx11-invalid-lambda.cpp === --- /dev/null +++

[PATCH] D39416: [modules] Correctly overload getModule in the MultiplexExternalSemaSource

2017-10-30 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor created this revision. The MultiplexExternalSemaSource doesn't correctly overload the `getModule` function, causing the multiplexer to not forward this call as intended. https://reviews.llvm.org/D39416 Files: include/clang/Sema/MultiplexExternalSemaSource.h

r316906 - Keep MSVC2015 happy after r316903

2017-10-30 Thread Krasimir Georgiev via cfe-commits
Author: krasimir Date: Mon Oct 30 07:30:14 2017 New Revision: 316906 URL: http://llvm.org/viewvc/llvm-project?rev=316906=rev Log: Keep MSVC2015 happy after r316903 Modified: cfe/trunk/lib/Format/Format.cpp Modified: cfe/trunk/lib/Format/Format.cpp URL:

[PATCH] D39365: [libunwind] Change unw_word_t to always have the same size as the pointer size

2017-10-30 Thread David Chisnall via Phabricator via cfe-commits
theraven added a comment. This makes things worse for us. On CHERI, `[u]intptr_t` is a (`typedef` for a) built-in type that can hold a capability. Having `unw_word_t` be `uintptr_t` made LLVM's libunwind considerably easier to port than the HP unwinder would have been, because `uintptr_t` is

r316903 - [clang-format] Format raw string literals

2017-10-30 Thread Krasimir Georgiev via cfe-commits
Author: krasimir Date: Mon Oct 30 07:01:50 2017 New Revision: 316903 URL: http://llvm.org/viewvc/llvm-project?rev=316903=rev Log: [clang-format] Format raw string literals Summary: This patch adds raw string literal formatting. Reviewers: djasper, klimek Reviewed By: klimek Subscribers:

[PATCH] D39416: [modules] Correctly overload getModule in the MultiplexExternalSemaSource

2017-10-30 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor updated this revision to Diff 120808. teemperor added a comment. - Removed `virtual` keyword when we already have `override`. https://reviews.llvm.org/D39416 Files: include/clang/Sema/MultiplexExternalSemaSource.h lib/Sema/MultiplexExternalSemaSource.cpp Index:

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120776. baloghadamsoftware added a comment. Oops! Sorry! https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h docs/ReleaseNotes.rst

[PATCH] D39049: [analyzer] Fix wrong calculation of offset in ArrayBoundsV2

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. // TODO: once the constraint manager is smart enough to handle non simplified // symbolic expressions remove this function. Note that this can not be used in // the constraint manager as is, since this does not handle overflows. It is // safe to assume, however, that

r316885 - [analyzer] Handle ObjC messages conservatively in CallDescription

2017-10-30 Thread Gabor Horvath via cfe-commits
Author: xazax Date: Mon Oct 30 01:47:13 2017 New Revision: 316885 URL: http://llvm.org/viewvc/llvm-project?rev=316885=rev Log: [analyzer] Handle ObjC messages conservatively in CallDescription Differential Revision: https://reviews.llvm.org/D37470 Added:

[PATCH] D37470: [analyzer] Handle ObjC messages conservatively in CallDescription

2017-10-30 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316885: [analyzer] Handle ObjC messages conservatively in CallDescription (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D37470?vs=120598=120778#toc Repository: rL LLVM

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#909255, @aaron.ballman wrote: > My only remaining concern is with the diagnostic message/fixit interaction > itself. Let's see if @alexfh has any suggestions there, or we think of an > improvement ourselves. What do you

[PATCH] D38986: [Analyzer] Better unreachable message in enumeration

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. > Does llvm_unreachable() guarantee that the string construction code is > completely removed from release builds? http://llvm.org/docs/CodingStandards.html#assert-liberally: > When assertions are disabled (i.e. in release builds), `llvm_unreachable` > becomes a hint to

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 120820. barancsuk marked 17 inline comments as done. barancsuk added a comment. Address review comments, discard ambiguously redundant macro expressions https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp

r316909 - CodeGen: Fix insertion position of addrspace cast for alloca

2017-10-30 Thread Yaxun Liu via cfe-commits
Author: yaxunl Date: Mon Oct 30 07:38:30 2017 New Revision: 316909 URL: http://llvm.org/viewvc/llvm-project?rev=316909=rev Log: CodeGen: Fix insertion position of addrspace cast for alloca For non-zero alloca addr space, alloca is usually casted to default addr space immediately. For non-vla,

[PATCH] D39374: CodeGen: Fix insertion position of addrspace cast for alloca

2017-10-30 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316909: CodeGen: Fix insertion position of addrspace cast for alloca (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D39374?vs=120609=120823#toc Repository: rL LLVM

[PATCH] D39008: [CodeGen] Propagate may-alias'ness of lvalues with TBAA info

2017-10-30 Thread Ivan Kosarev via Phabricator via cfe-commits
kosarev updated this revision to Diff 120828. kosarev added a comment. - Fixed comparing and hashing of TBAA access descriptors. - Rebased on top of https://reviews.llvm.org/D39177. Thanks John! https://reviews.llvm.org/D39008 Files: lib/CodeGen/CGExpr.cpp lib/CodeGen/CGObjCRuntime.cpp

Re: r316403 - [Analyzer] Fix for the memory leak: fix typo in if-statement.

2017-10-30 Thread David Blaikie via cfe-commits
I realize this was changed in a follow-up commit anyway, but for future reference: There's no need (& best to avoid - simpler to read, avoids bugs like this, etc) to conditionalize delete like this. Delete is a no-op on null pointers anyway, so this dtor should just contain an unconditional

Re: [PATCH] D39208: [Analyzer] Do not use static storage to for implementations created in BodyFarm.cpp

2017-10-30 Thread David Blaikie via cfe-commits
On Mon, Oct 23, 2017 at 5:01 PM George Karpenkov via Phabricator via cfe-commits wrote: > george.karpenkov added a comment. > > @dcoughlin the context I was thinking about is that if everyone > consistently runs `clang-format` (if we want that), then we never would >

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39121#910715, @aaron.ballman wrote: > The diagnostic tells the user that you surround the arg to strlen with parens > to silence the diagnostic, but the fixit doesn't do that -- it moves the > addition to the result. That's

[libcxx] r316914 - Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis Yaroshevskiy for both the bug report and the fix.

2017-10-30 Thread Marshall Clow via cfe-commits
Author: marshall Date: Mon Oct 30 08:50:00 2017 New Revision: 316914 URL: http://llvm.org/viewvc/llvm-project?rev=316914=rev Log: Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis Yaroshevskiy for both the bug report and the fix. Added:

[PATCH] D39405: std::set_union accesses values after move.

2017-10-30 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists accepted this revision. mclow.lists added a comment. This revision is now accepted and ready to land. Committed as revision 316914. Thanks! https://reviews.llvm.org/D39405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39396: Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.

2017-10-30 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: include/llvm/IR/Metadata.h:961 + /// \brief Resolve a unique, unresolved node. + void resolve(); The `\brief ` is redundant and can be dropped. https://reviews.llvm.org/D39396

[PATCH] D39365: [libunwind] Change unw_word_t to always have the same size as the pointer size

2017-10-30 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D39365#910713, @theraven wrote: > Sorry - it looks as if I read the diff back to front. I seem to be less > awake than I thought today... > > Reading the diff the correct way around, this seems like a definite > improvement. Ok, thanks!

[PATCH] D39396: Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.

2017-10-30 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment. > The only drawback is that the cloned function's (the thunk's) > DILocalVariableNodes will not appear in the newly cloned DISubprogram's node > variable list. Instead, the new node points to the original function's > variable list. However, since the only difference

[libcxx] r316917 - Mark test as unsupported on C++98/03, since it uses move_iterator

2017-10-30 Thread Marshall Clow via cfe-commits
Author: marshall Date: Mon Oct 30 09:07:59 2017 New Revision: 316917 URL: http://llvm.org/viewvc/llvm-project?rev=316917=rev Log: Mark test as unsupported on C++98/03, since it uses move_iterator Modified:

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:633-635 +// The function discards (X < M1 && X <= M2), because it can always be +// simplified to X < M, where M is the smaller one of the two macro +// values.

r316910 - [clang-format] Handle CRLF correctly when formatting escaped newlines

2017-10-30 Thread Krasimir Georgiev via cfe-commits
Author: krasimir Date: Mon Oct 30 07:41:34 2017 New Revision: 316910 URL: http://llvm.org/viewvc/llvm-project?rev=316910=rev Log: [clang-format] Handle CRLF correctly when formatting escaped newlines Subscribers: klimek Differential Revision: https://reviews.llvm.org/D39420 Contributed by

[PATCH] D37897: [StaticAnalyzer] Fix ProgramState for static variables that are not written

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. > however as far as I see this will mean the LoopUnroller AST matchers can't be > reused unless I change them. Hmm. What is the problem here? I'm expecting library linkage issues (i.e. libAnalysis is not linked to libASTMatchers directly), but i guess it'd better to have

[PATCH] D39365: [libunwind] Change unw_word_t to always have the same size as the pointer size

2017-10-30 Thread David Chisnall via Phabricator via cfe-commits
theraven added a comment. In https://reviews.llvm.org/D39365#910622, @mstorsjo wrote: > In https://reviews.llvm.org/D39365#910590, @theraven wrote: > > > This makes things worse for us. On CHERI, `[u]intptr_t` is a (`typedef` > > for a) built-in type that can hold a capability. Having

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D39121#910440, @baloghadamsoftware wrote: > In https://reviews.llvm.org/D39121#909255, @aaron.ballman wrote: > > > My only remaining concern is with the diagnostic message/fixit interaction > > itself. Let's see if @alexfh has any

Re: r316536 - [Analyzer] Store BodyFarm in std::unique_ptr

2017-10-30 Thread David Blaikie via cfe-commits
Could this be a value rather than indirected through a unique_ptr? Simply: BodyFarm BdyFrm; & initialized in the ctors init list? On Tue, Oct 24, 2017 at 4:53 PM George Karpenkov via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: george.karpenkov > Date: Tue Oct 24 16:53:19 2017

[PATCH] D39422: [analyzer] pr34779: CStringChecker: Don't get crashed by non-standard standard library function definitions.

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. An assertion failure was triggered in pr34779 by defining `strcpy` as `void (unsigned char *, unsigned char *)`, while normally it is `char *(char *, char *)`. The assertion is removed because normally we try not to crash in such cases, but simply refuse to model.

[PATCH] D39423: [analyzer] Left shifting a negative value is undefined

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. Herald added subscribers: szepet, baloghadamsoftware, whisperity. The analyzer did not return an UndefVal in case a negative value was left shifted. I also added altered the UndefResultChecker to emit a clear warning in this case. Repository: rL LLVM

[PATCH] D39239: [AST] Incorrectly qualified unscoped enumeration as template actual parameter.

2017-10-30 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a reviewer: tberghammer. CarlosAlbertoEnciso added a comment. Hi Tamas, I have added you to this review, as I think I have found something odd with the LLDB. Basically after this intended patch to the compiler (to emit scoped information only for scoped enums) the

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D39121#910735, @baloghadamsoftware wrote: > In https://reviews.llvm.org/D39121#910715, @aaron.ballman wrote: > > > The diagnostic tells the user that you surround the arg to strlen with > > parens to silence the diagnostic, but the

[PATCH] D39422: [analyzer] pr34779: CStringChecker: Don't get crashed by non-standard standard library function definitions.

2017-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. This patch looks good to me. I am wondering whether it would make sense to have some kind of warning (even in the frontend if not in the analyzer) for using standard functions with

[PATCH] D39370: [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc even in the case the allocation function is called using a constant function pointer

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM FYI: it's been difficult to perform this review because all of these reviews are touching the same chunk of code for something that's not been committed yet. It would be

Re: [PATCH] D24886: Add [[clang::suppress(rule, ...)]] attribute

2017-10-30 Thread Aaron Ballman via cfe-commits
On Sun, Oct 29, 2017 at 4:42 AM, Hristo Hristov via Phabricator wrote: > roccoor added a comment. > > Microsoft supports: > > [[gsl::suppress(bounds.3)]] > > Clang requires: > > [[gsl::suppress("bounds.3")]] > > Why is this inconsistency? I believe that when we

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:633-635 +// The function discards (X < M1 && X <= M2), because it can always be +// simplified to X < M, where M is the smaller one of the two macro +// values.

[PATCH] D39239: [AST] Incorrectly qualified unscoped enumeration as template actual parameter.

2017-10-30 Thread Tamas Berghammer via Phabricator via cfe-commits
tberghammer added a comment. 2 fairly random ideas without looking into it too much: - Can you do a diff of the debug_info dump before and after your change? Understanding what have changed should give us a pretty good clue about the issue. - My first guess is that after your change we emit

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D39367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39370: [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc even in the case the allocation function is called using a constant function pointer

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D39370#910791, @aaron.ballman wrote: > LGTM > > FYI: it's been difficult to perform this review because all of these reviews > are touching the same chunk of code for something that's not been committed > yet. It would be easier

[PATCH] D39370: [clang-tidy] Detect bugs in bugprone-misplaced-operator-in-strlen-in-alloc even in the case the allocation function is called using a constant function pointer

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D39370#910803, @baloghadamsoftware wrote: > In https://reviews.llvm.org/D39370#910791, @aaron.ballman wrote: > > > LGTM > > > > FYI: it's been difficult to perform this review because all of these > > reviews are touching the same chunk

[PATCH] D39365: [libunwind] Change unw_word_t to always have the same size as the pointer size

2017-10-30 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D39365#909912, @compnerd wrote: > @rnk given that the remote unwinder is completely unimplemented ATM, I think > that this isn't a big concern. I'm not sure that this

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. I dislike this change fairly strongly. I would much rather pursue a clang-based solution (since clang is being unhelpful here) Don't know if we can get one, though. https://reviews.llvm.org/D39149 ___ cfe-commits

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D39149#910936, @smeenai wrote: > I'm thinking you could account for all possible type sizes in the existing > (enabled by default) warning, and have a different warning for possibly > tautological comparisons. E.g. if a `long` is being

[PATCH] D36101: Fix usage of right shift operator in fold expressions

2017-10-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Thanks! Comment at: lib/Parse/ParseExpr.cpp:273 static bool isFoldOperator(tok::TokenKind Kind) { - return isFoldOperator(getBinOpPrecedence(Kind, false, true)); + return

[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

2017-10-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 120890. lebedev.ri marked 2 inline comments as done. lebedev.ri added a comment. Ping. Rebased. Silenced (via the `-w` flag in the `RUN` line) the `Fix conflicts with existing fix!` assertion since this differential does not actually cause it, but the

r316965 - [modules] Retain multiple using-directives in the same scope even if they name the same namespace.

2017-10-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Oct 30 15:38:20 2017 New Revision: 316965 URL: http://llvm.org/viewvc/llvm-project?rev=316965=rev Log: [modules] Retain multiple using-directives in the same scope even if they name the same namespace. They might have different visibility, and thus discarding all but

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. In https://reviews.llvm.org/D39149#911024, @rsmith wrote: > In https://reviews.llvm.org/D39149#910936, @smeenai wrote: > > > I'm thinking you could account for all possible type sizes in the existing > > (enabled by default) warning, and have a different warning for

[PATCH] D35894: [clangd] Code hover for Clangd

2017-10-30 Thread William Enright via Phabricator via cfe-commits
Nebiroth added a comment. I also have a quick patch that supports displaying comments preceding the declaration of a function. Once the review comments have been addressed for this revision I will submit it. https://reviews.llvm.org/D35894 ___

[PATCH] D39430: [clangd] formatting: don't ignore style

2017-10-30 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. For testing you could do something similar to how clang-format does it . https://reviews.llvm.org/D39430 ___ cfe-commits mailing list

[PATCH] D39438: [analyzer] Diagnose stack leaks via block captures

2017-10-30 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap created this revision. Herald added subscribers: szepet, xazax.hun. This diff extends StackAddrEscapeChecker to catch stack addr leaks via block captures if the block is executed asynchronously. Test plan: make check-all Repository: rL LLVM https://reviews.llvm.org/D39438 Files:

Re: r315402 - [modules] Only take visible using-directives into account during name lookup.

2017-10-30 Thread Vassil Vassilev via cfe-commits
On 30/10/17 23:40, Richard Smith wrote: On 30 October 2017 at 15:12, Vassil Vassilev via cfe-commits > wrote: On 11/10/17 03:19, Richard Smith via cfe-commits wrote: Author: rsmith Date: Tue Oct 10 18:19:11

Re: r315402 - [modules] Only take visible using-directives into account during name lookup.

2017-10-30 Thread Vassil Vassilev via cfe-commits
On 11/10/17 03:19, Richard Smith via cfe-commits wrote: Author: rsmith Date: Tue Oct 10 18:19:11 2017 New Revision: 315402 URL: http://llvm.org/viewvc/llvm-project?rev=315402=rev Log: [modules] Only take visible using-directives into account during name lookup. Added:

Re: r315402 - [modules] Only take visible using-directives into account during name lookup.

2017-10-30 Thread Richard Smith via cfe-commits
On 30 October 2017 at 15:12, Vassil Vassilev via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On 11/10/17 03:19, Richard Smith via cfe-commits wrote: > >> Author: rsmith >> Date: Tue Oct 10 18:19:11 2017 >> New Revision: 315402 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=315402=rev

Re: r316965 - [modules] Retain multiple using-directives in the same scope even if they name the same namespace.

2017-10-30 Thread Richard Smith via cfe-commits
I should add: the test is courtesy of Vassil Vassilev. Thanks! On 30 October 2017 at 15:38, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Mon Oct 30 15:38:20 2017 > New Revision: 316965 > > URL: http://llvm.org/viewvc/llvm-project?rev=316965=rev >

[PATCH] D35894: [clangd] Code hover for Clangd

2017-10-30 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 120894. Nebiroth added a comment. Code hover now displays declaration of symbol instead of source code by default. Code hover now displays context information such as namespace and class name. Array of MarkedString objects is now sent as response in JSON.

[PATCH] D39269: [Analyzer] [Tests] Do not discard output from CmpRuns.py when running integration tests

2017-10-30 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. @zaks.anna prints "XXX added / XXX removed" for every report which has appeared or disappeared. https://reviews.llvm.org/D39269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39149: [libc++] Prevent tautological comparisons

2017-10-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D39149#911024, @rsmith wrote: > In https://reviews.llvm.org/D39149#910936, @smeenai wrote: > > > I'm thinking you could account for all possible type sizes in the existing > > (enabled by default) warning, and have a different warning for

[PATCH] D39204: [CodeGen] __builtin_sqrt should map to the compiler's intrinsic sqrt function

2017-10-30 Thread Sanjay Patel via Phabricator via cfe-commits
spatel updated this revision to Diff 120902. spatel added a comment. Patch updated: As suggested, I've morphed this patch to just handle sqrt libcalls based on the updated LLVM intrinsic definition. I was going to include the builtins too, but that exposes another bug (marked here with FIXME)

[PATCH] D39430: [clangd] formatting: don't ignore style

2017-10-30 Thread Raoul Wols via Phabricator via cfe-commits
rwols added a comment. Does anyone have an idea how I would write a test for this? Also, I should have commit access after approval now. So that's less work for you guys ;) https://reviews.llvm.org/D39430 ___ cfe-commits mailing list

r316963 - [analyzer] Use the same filename for the header and the implementation of BugReporterVisitor

2017-10-30 Thread George Karpenkov via cfe-commits
Author: george.karpenkov Date: Mon Oct 30 15:31:57 2017 New Revision: 316963 URL: http://llvm.org/viewvc/llvm-project?rev=316963=rev Log: [analyzer] Use the same filename for the header and the implementation of BugReporterVisitor Differential Revision: https://reviews.llvm.org/D37935 Added:

[PATCH] D39446: [PGO] Detect more structural changes with the stable hash

2017-10-30 Thread Vedant Kumar via Phabricator via cfe-commits
vsk created this revision. Lifting from Bob Wilson's notes: The hash value that we compute and store in PGO profile data to detect out-of-date profiles does not include enough information. This means that many significant changes to the source will not cause compiler warnings about the profile

[PATCH] D39396: Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.

2017-10-30 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment. I see. Then it makes sense to do it this way. Thanks for clarifying! https://reviews.llvm.org/D39396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39284: [c++2a] Decomposed _condition_

2017-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 120913. lichray added a comment. Make the feature unconditional with an `ExtWarn` https://reviews.llvm.org/D39284 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/DeclSpec.h lib/Parse/ParseExprCXX.cpp lib/Sema/SemaDeclCXX.cpp

[PATCH] D39396: Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.

2017-10-30 Thread Wolfgang Pieb via Phabricator via cfe-commits
wolfgangp marked an inline comment as done. wolfgangp added a comment. In https://reviews.llvm.org/D39396#911306, @aprantl wrote: > This works for me, but as I said previously, perhaps we can get by with just > not having any variables described in the thunk to further simplify the code. I

[PATCH] D39284: Allow conditions to be decomposed with structured bindings

2017-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 3 inline comments as done. lichray added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:696-698 + // a for-range-declaration, or a condition in C++2a, but we parse it in more + // cases than that. + if (!D.mayHaveDecompositionDeclarator(getLangOpts())) {

[PATCH] D39204: [CodeGen] __builtin_sqrt should map to the compiler's intrinsic sqrt function

2017-10-30 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. > I was going to include the builtins too, but that exposes another bug (marked > here with FIXME) - the builtins are all defined 'const'. Probably just need to change c->e in Builtins.def? > This does make me curious about the use-case of libm-equivalent builtins. If

r316966 - Typo correct the condition of 'do-while' before exiting its scope

2017-10-30 Thread Alex Lorenz via cfe-commits
Author: arphaman Date: Mon Oct 30 15:55:11 2017 New Revision: 316966 URL: http://llvm.org/viewvc/llvm-project?rev=316966=rev Log: Typo correct the condition of 'do-while' before exiting its scope rdar://35172419 Modified: cfe/trunk/lib/Parse/ParseStmt.cpp

[PATCH] D39396: Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.

2017-10-30 Thread Wolfgang Pieb via Phabricator via cfe-commits
wolfgangp marked 5 inline comments as done. wolfgangp added inline comments. Comment at: lib/CodeGen/CGVTables.cpp:143 + for (llvm::Function::iterator BB = Fn->begin(), E = Fn->end(); BB != E; + ++BB) { +for (llvm::Instruction : *BB) { aprantl wrote:

[PATCH] D39422: [analyzer] pr34779: CStringChecker: Don't get crashed by non-standard standard library function definitions.

2017-10-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/string-with-signedness.c:1 +// RUN: %clang_analyze_cc1 -Wno-incompatible-library-redeclaration -analyzer-checker=core,unix.cstring,alpha.unix.cstring -verify %s + We do have a warning for this.

[PATCH] D39121: [clang-tidy] Misplaced Operator in Strlen in Alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I thought on something like this, but I still do not like my phrasing: "Addition operator is applied to the argument of strlen(). instead of its result; move the '+ 1' outside of the call. (Or, if it is intentional then surround the addition subexpression

[libcxx] r316969 - Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFC

2017-10-30 Thread Marshall Clow via cfe-commits
Author: marshall Date: Mon Oct 30 17:05:17 2017 New Revision: 316969 URL: http://llvm.org/viewvc/llvm-project?rev=316969=rev Log: Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFC Added:

[PATCH] D39284: Allow conditions to be decomposed with structured bindings

2017-10-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:696-698 + // a for-range-declaration, or a condition in C++2a, but we parse it in more + // cases than that. + if (!D.mayHaveDecompositionDeclarator(getLangOpts())) { lichray wrote: > rsmith

[PATCH] D39396: Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.

2017-10-30 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl accepted this revision. aprantl added a comment. This revision is now accepted and ready to land. This works for me, but as I said previously, perhaps we can get by with just not having any variables described in the thunk to further simplify the code. https://reviews.llvm.org/D39396

r316971 - [refactor] select the entire DeclStmt if one ifs decls is selected

2017-10-30 Thread Alex Lorenz via cfe-commits
Author: arphaman Date: Mon Oct 30 18:28:17 2017 New Revision: 316971 URL: http://llvm.org/viewvc/llvm-project?rev=316971=rev Log: [refactor] select the entire DeclStmt if one ifs decls is selected Modified: cfe/trunk/lib/Tooling/Refactoring/ASTSelection.cpp

[PATCH] D39441: [refactor][extract] insert semicolons into extracted/inserted code when needed

2017-10-30 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. Herald added a subscriber: mgorny. This patch implements the semicolon insertion logic into the extract refactoring. The following rules are taken: - extracting expression: add terminating ';' to the extracted function. - extracting statements that don't require

  1   2   >