[PATCH] D21303: [clang-tidy] Adds performance-returning-type check.

2017-04-23 Thread Jakub StaroĊ„ via Phabricator via cfe-commits
staronj abandoned this revision. staronj marked 9 inline comments as done. staronj added a comment. Because of https://reviews.llvm.org/D21619 the check is no longer required. https://reviews.llvm.org/D21303 ___ cfe-commits mailing list cfe-commits@

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Jakub Kuderski via Phabricator via cfe-commits
kuhar created this revision. kuhar added a project: clang-tools-extra. When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call. Eg. std::vector> v; v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2); make_pair does

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. please note this enhancement in the ReleaseNotes. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:93 + to(functionDecl(hasName("::std::make_pair" + + .bind("make_pair")); is the new lin

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:93 + to(functionDecl(hasName("::std::make_pair" + + .bind("make_pair")); JonasToth wrote: > is the new line here necessary? i think it l

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-23 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 96303. madsravn added a comment. Small changes to code due to comments. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp clang

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added inline comments. Comment at: test/clang-tidy/modernize-use-emplace.cpp:284 + // CHECK-FIXES: v.emplace_back(42LL, 13); + + v.push_back(std::make_pair(0, 3)); I would add here test like: class X { X(std:;pair a) {} }; std::vector v;

[clang-tools-extra] r301130 - clang-rename: fix formatting

2017-04-23 Thread Miklos Vajna via cfe-commits
Author: vmiklos Date: Sun Apr 23 11:07:06 2017 New Revision: 301130 URL: http://llvm.org/viewvc/llvm-project?rev=301130&view=rev Log: clang-rename: fix formatting As detected by clang-format. Modified: clang-tools-extra/trunk/clang-rename/RenamingAction.cpp clang-tools-extra/trunk/clang-

[PATCH] D32378: Insert invariant.group.barrier for pointers comparisons

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek marked an inline comment as done. Prazek added inline comments. Comment at: lib/CodeGen/CGExprScalar.cpp:3066-3067 +} else { // Unsigned integers and pointers. + if (CGF.CGM.getCodeGenOpts().StrictVTablePointers && + CGF.CGM.getCodeGenOpts().OptimizationL

[PATCH] D32378: Insert invariant.group.barrier for pointers comparisons

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek updated this revision to Diff 96311. Prazek marked an inline comment as done. Prazek added a comment. Addressing Richard's comment https://reviews.llvm.org/D32378 Files: lib/CodeGen/CGExprScalar.cpp test/CodeGenCXX/strict-vtable-pointers.cpp Index: test/CodeGenCXX/strict-vtable-poin

[PATCH] D31830: Emit invariant.group.barrier when using union field

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek updated this revision to Diff 96312. Prazek added a comment. - Inserting barrier with -O0 https://reviews.llvm.org/D31830 Files: lib/CodeGen/CGExpr.cpp test/CodeGenCXX/strict-vtable-pointers.cpp Index: test/CodeGenCXX/strict-vtable-pointers.cpp ==

[PATCH] D32181: Remove use of coverage-file flag

2017-04-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Ping. (If I don't hear back, I will assume this is noncontroversial and go ahead and commit sometime next week.) https://reviews.llvm.org/D32181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D32378: Insert invariant.group.barrier for pointers comparisons

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added a comment. This is actually good catch, we also need to do it when inserting barrier in placement new. I think that for the ctors and dtors we can do it only with optimizations enabled, because if optimizations are not enabled then ctors and dtors won't have the invariant.group in

[PATCH] D31542: [clang-tidy] Extend readability-container-size-empty to add comparisons to newly-constructed objects

2017-04-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D31542#734455, @joshz wrote: > Are there any further changes I should make, or is this good to submit now? > > Thanks! This still LGTM, so it's good to submit. Do you still need someone to land the patch for you? Repository: rL LLV

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This continues to LGTM; do you need someone to land the patch for you? Comment at: test/clang-tidy/modernize-replace-random-shuffle.cpp:40 + + + std::shuffle(vec.begin(), vec.end()); Can remove the extra newline. https://review

[PATCH] D32401: [Devirtualization] insert placement new barrier with -O0

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek created this revision. Herald added a subscriber: mehdi_amini. To not break LTO with different optimizations levels, we should insert the barrier regardles of optimization level. https://reviews.llvm.org/D32401 Files: lib/CodeGen/CGExprCXX.cpp Index: lib/CodeGen/CGExprCXX.cpp ===

[libcxx] r301132 - Add missing acquire_load to call_once overload.

2017-04-23 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sun Apr 23 11:58:48 2017 New Revision: 301132 URL: http://llvm.org/viewvc/llvm-project?rev=301132&view=rev Log: Add missing acquire_load to call_once overload. Summary: Seemed to have been overlooked in D24028. This bug was found and brought to my attention by Paul Wankadia.

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-23 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. In https://reviews.llvm.org/D30158#734810, @aaron.ballman wrote: > This continues to LGTM; do you need someone to land the patch for you? I will remove the extra newline and land the patch tomorrow. Thanks! :) https://reviews.llvm.org/D30158 __

[PATCH] D32401: [Devirtualization] insert placement new barrier with -O0

2017-04-23 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Won't you have the exact same problem when LTO'ing with code that wasn't compiled with strict v-table pointers? https://reviews.llvm.org/D32401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

[PATCH] D32401: [Devirtualization] insert placement new barrier with -O0

2017-04-23 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added a comment. > To not break LTO with different optimizations levels, we should insert the > barrier regardles of optimization level. What do you mean by "break"? Is it a correctness issue? https://reviews.llvm.org/D32401 ___ cfe-co

[PATCH] D32406: [Coverage][Windows] Null pointer dereference in CodeGenPGO::skipRegionMappingForDecl (fixes PR32761)

2017-04-23 Thread Adam Folwarczny via Phabricator via cfe-commits
adamf created this revision. In function CodeGenPGO::skipRegionMappingForDecl there is possible NULL pointer dereference on line: auto Loc = D->getBody()->getLocStart(); Value returned by getBody may be NULL. In corresponding test it happens during processing the virtual destructor ~A. (minor)

r301138 - Fix typo in comment.

2017-04-23 Thread Nick Lewycky via cfe-commits
Author: nicholas Date: Sun Apr 23 15:46:58 2017 New Revision: 301138 URL: http://llvm.org/viewvc/llvm-project?rev=301138&view=rev Log: Fix typo in comment. Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h URL: http://llv

[PATCH] D32341: Fix a bug that warnings generated with -M or -MM flags

2017-04-23 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor requested changes to this revision. teemperor added a comment. This revision now requires changes to proceed. This also disables warnings for `-MD` and `-MMD` which shouldn't happen as we're actually compiling code here and are probably compiling a project. E.g. for people that use thi

[PATCH] D32401: [Devirtualization] insert placement new barrier with -O0

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D32401#734870, @rjmccall wrote: > Won't you have the exact same problem when LTO'ing with code that wasn't > compiled with strict v-table pointers? No, because we fire error when combining module compiled with and without StrictVtablePoint

[PATCH] D32401: [Devirtualization] insert placement new barrier with -O0

2017-04-23 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I continue to be really uncomfortable with the entire design of this optimization, which appears to miscompile code by default, but as long as nobody's suggesting that we actually turn it on by default, I guess it can be your little research-compiler playground. It mi

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Jakub Kuderski via Phabricator via cfe-commits
kuhar updated this revision to Diff 96329. kuhar added a comment. Add test for pair constructor argument, mention changes in release notes. https://reviews.llvm.org/D32395 Files: clang-tidy/modernize/UseEmplaceCheck.cpp docs/ReleaseNotes.rst test/clang-tidy/modernize-use-emplace.cpp Inde

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Jakub Kuderski via Phabricator via cfe-commits
kuhar marked 2 inline comments as done. kuhar added inline comments. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:93 + to(functionDecl(hasName("::std::make_pair" + + .bind("make_pair")); Prazek wrote: > JonasTot

[PATCH] D32410: change the way objcboxedexpr is handled

2017-04-23 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. Make ObjCBoxedExpr less of a special case, teach the expression evaluator to handle it in general, sometimes descending through to its subexpr. Remove the code that called CheckForIntOverflow from outside BuildObjCBoxedExpr, leaving its only caller CheckCompleted

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Jakub Kuderski via Phabricator via cfe-commits
kuhar updated this revision to Diff 96332. kuhar marked an inline comment as done. kuhar added a comment. Update modernize-use-emplace rst docs. https://reviews.llvm.org/D32395 Files: clang-tidy/modernize/UseEmplaceCheck.cpp docs/ReleaseNotes.rst docs/clang-tidy/checks/modernize-use-empla

[PATCH] D28462: clang-format: Add new style option AlignConsecutiveMacros

2017-04-23 Thread Erik Nyquist via Phabricator via cfe-commits
enyquist marked 2 inline comments as done. enyquist added inline comments. Comment at: lib/Format/WhitespaceManager.cpp:413 + + while (Param && !Param->is(tok::l_paren)) { +if (!Param->is(tok::identifier) && !Param->is(tok::comma)) djasper wrote: > enyquist

[PATCH] D28462: clang-format: Add new style option AlignConsecutiveMacros

2017-04-23 Thread Erik Nyquist via Phabricator via cfe-commits
enyquist updated this revision to Diff 96333. enyquist marked an inline comment as done. enyquist added a comment. Addressed comments Repository: rL LLVM https://reviews.llvm.org/D28462 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/Format.cpp lib/Fo

[PATCH] D28462: clang-format: Add new style option AlignConsecutiveMacros

2017-04-23 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: lib/Format/WhitespaceManager.cpp:431 + + // Special case for AlignTokens: for all other alignment cases, + // the current sequence is ended when a comma or a scope change enyquist wrote: > djasp

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-04-23 Thread Ben Craig via Phabricator via cfe-commits
bcraig created this revision. Herald added a subscriber: mgorny. Visual Studio 2015 and 2017 don't implement include_next, so we'll use a combination of a computed include and a CMAKE input to make it work. Also, retrofit all the existing invocations of #include_next that we could hit in a hyp

[PATCH] D32412: analyze all kinds of expressions for integer overflow

2017-04-23 Thread Nick Lewycky via Phabricator via cfe-commits
nlewycky created this revision. Remove clang::Sema::CheckForIntOverflow(E) by calling into E->EvaluateForOverflow instead. CheckForIntOverflow implemented a whitelist of top-level expressions to check, currently BinaryOperator and InitListExpr. Two changes are made to avoid regression with the

[PATCH] D28462: clang-format: Add new style option AlignConsecutiveMacros

2017-04-23 Thread Erik Nyquist via Phabricator via cfe-commits
enyquist added inline comments. Comment at: lib/Format/WhitespaceManager.cpp:431 + + // Special case for AlignTokens: for all other alignment cases, + // the current sequence is ended when a comma or a scope change djasper wrote: > enyqu

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-04-23 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. Here is how we solved this problem in our libc++ fork: #define _LIBCPP_UCRT_INCLUDE(x) <../ucrt/x> #define _LIBCPP_MSVC_INCLUDE(x) <../../VC/include/x> #ifdef _LIBCPP_COMPILER_MSVC #include _LIBCPP_UCRT_INCLUDE(wchar.h) #else #include_next #endif As fa

[PATCH] D31868: [analyzer] Check NULL pointer dereference issue for memset function

2017-04-23 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 96344. xiangzhai added a comment. Hi Artem, Because `memcpy` checked NULL pointer dereference for `src`: state = checkNonNull(C, state, Source, srcVal); ... so such testcase can not point out my fault: void f15 () {