[PATCH] D55576: [libcxx] [test] [support] Use socket()+bind() to create unix sockets portably

2018-12-11 Thread Michał Górny via Phabricator via cfe-commits
mgorny created this revision. mgorny added reviewers: EricWF, krytarowski. Herald added subscribers: libcxx-commits, ldionne, emaste. Replace the mknod() call with socket() + bind() for creating unix sockets. The mknod() method is not portable and does not work on NetBSD while binding the socket

[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

2018-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
hgabii updated this revision to Diff 177812. hgabii added a comment. Highlight type names in documentation. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D48866/new/ https://reviews.llvm.org/D48866 Files: clang-tidy/misc/CMakeLists.txt

[PATCH] D55534: [AST] Store "UsesADL" information in CallExpr.

2018-12-11 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF marked an inline comment as done. EricWF added inline comments. Comment at: docs/LibASTMatchersReference.html:2579-2581 +y(x); Matches +NS::y(x); Doesn't match +y(42); Doesn't match. aaron.ballman wrote: > EricWF wrote: > > aaron.ballman

[PATCH] D55413: [ExprConstant] Handle compound assignment when LHS has integral type and RHS has floating point type

2018-12-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:3441 + Value); +} APSInt LHS = HandleIntToIntCast(Info, E, PromotedLHSType, Can we more fundamentally restructure this entire handler so that, if

[PATCH] D48753: [libcxx] Use custom allocator's `construct` in C++03 when available.

2018-12-11 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai marked an inline comment as done. vsapsai added a comment. In D48753#1323248 , @ldionne wrote: > 2. Also, before this patch, the allocator's `construct` and `destroy` were > NEVER called in C++03, but were called when available in C++11. After

Re: r346789 - DebugInfo: Add a driver flag for DWARF debug_ranges base address specifier use.

2018-12-11 Thread David Blaikie via cfe-commits
(tiny factoid: turns out gold's 64 bit gdb-index support is also broken in a different, more subtle way... - so best folks don't use this flag except with lld, it seems, if you're using gdb-index) On Tue, Nov 13, 2018 at 12:10 PM David Blaikie via cfe-commits < cfe-commits@lists.llvm.org> wrote:

[PATCH] D54604: Automatic variable initialization

2018-12-11 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. For the record: I'm OK with this direction. (I somewhat prefer removing the `-enable-long-wordy-thing` option and instead automatically disabling the `zero` option for clang release builds, but I'm OK with either approach.) Comment at:

[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

2018-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
hgabii updated this revision to Diff 177810. hgabii marked an inline comment as done. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D48866/new/ https://reviews.llvm.org/D48866 Files: clang-tidy/misc/CMakeLists.txt

[PATCH] D55543: [CodeGen] Fix assertion on throwing object with inlined inherited constructor and non-trivial destructor.

2018-12-11 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. I'd tried this exact same patch back in https://reviews.llvm.org/D44619, but I was running into a bunch of check-clang failures with it, and I was never able to figure them out. It looks like it works now though, so I'm glad :) Richard's comment from that diff might

[PATCH] D44619: [CodeGen] Add cleanup scope to EmitInlinedInheritingCXXConstructorCall

2018-12-11 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai abandoned this revision. smeenai added a comment. https://reviews.llvm.org/D55543 does the same thing Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44619/new/ https://reviews.llvm.org/D44619 ___ cfe-commits

[PATCH] D55510: [ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types

2018-12-11 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast marked 3 inline comments as done. hubert.reinterpretcast added inline comments. Comment at: lib/AST/ExprConstant.cpp:6147-6148 + return ZeroInitialization(E); +if (!Result.checkNullPointerForFoldAccess(Info, E, AK_Read)) + return false; +

[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

2018-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
hgabii added a comment. Check for different size and alignment as well. Tests migrated from D33826 . Warning in case of `reinterpret_cast`, but options is added to be able to turn it off. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION

r348907 - Move PCHContainerOperations from Frontend to Serialization

2018-12-11 Thread Richard Trieu via cfe-commits
Author: rtrieu Date: Tue Dec 11 18:53:59 2018 New Revision: 348907 URL: http://llvm.org/viewvc/llvm-project?rev=348907=rev Log: Move PCHContainerOperations from Frontend to Serialization Fix a layering violation. Frontend depends on Serialization, so anything used by both should be in

[PATCH] D55543: [CodeGen] Fix assertion on throwing object with inlined inherited constructor and non-trivial destructor.

2018-12-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Nice catch. This also fixes problems where there might be cleanups entered by `EmitParmDecl`, e.g. in ObjC++ with a parameter of type `struct A { __strong id x; }`; could you please add a test for that and verify that the parameter is destroyed at an appropriate

[PATCH] D55229: [COFF] Statically link certain runtime library functions

2018-12-11 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: CodeGen/CodeGenModule.cpp:2957-2958 !getCodeGenOpts().LTOVisibilityPublicStd && - !getTriple().isWindowsGNUEnvironment()) { + !getTriple().isWindowsGNUEnvironment() && +

[PATCH] D48753: [libcxx] Use custom allocator's `construct` in C++03 when available.

2018-12-11 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: libcxx/include/memory:1726 +#else // _LIBCPP_HAS_NO_VARIADICS +template +_LIBCPP_INLINE_VISIBILITY vsapsai wrote: > ldionne wrote: > > Here, > > > > ``` > > template >

[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

2018-12-11 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:139 + + Warns for cases when pointer is cast and the pointed to type is + incompatible with allocated memory area type. This may lead to access memory Please wrap up to 80 characters. Same

[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

2018-12-11 Thread Gábor Horváth via Phabricator via cfe-commits
hgabii marked 4 inline comments as done. hgabii added inline comments. Comment at: docs/ReleaseNotes.rst:139 + + Warns for cases when pointer is cast and the pointed to type is + incompatible with allocated memory area type. This may lead to access memory

[PATCH] D55525: [Driver] Add support for -fembed-bitcode for assembly file

2018-12-11 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd accepted this revision. compnerd added a comment. This revision is now accepted and ready to land. Please do clang-format this. If this is already in the wild, then, I suppose that we don't have the option, but, this seems like something that should be written by the author of the

r348911 - [CodeGen] Fix -DBUILD_SHARED_LIBS=on build after rC348907

2018-12-11 Thread Fangrui Song via cfe-commits
Author: maskray Date: Tue Dec 11 22:07:33 2018 New Revision: 348911 URL: http://llvm.org/viewvc/llvm-project?rev=348911=rev Log: [CodeGen] Fix -DBUILD_SHARED_LIBS=on build after rC348907 Modified: cfe/trunk/lib/CodeGen/CMakeLists.txt Modified: cfe/trunk/lib/CodeGen/CMakeLists.txt URL:

[libunwind] r348836 - [SEH] Zero-initialize EXCEPTION_RECORD and UNWIND_HISTORY_TABLE before calling RtlUnwindEx

2018-12-11 Thread Martin Storsjo via cfe-commits
Author: mstorsjo Date: Tue Dec 11 01:53:11 2018 New Revision: 348836 URL: http://llvm.org/viewvc/llvm-project?rev=348836=rev Log: [SEH] Zero-initialize EXCEPTION_RECORD and UNWIND_HISTORY_TABLE before calling RtlUnwindEx This fixes PR39935. Modified: libunwind/trunk/src/Unwind-seh.cpp

[PATCH] D54862: [OpenCL] Add generic AS to 'this' pointer

2018-12-11 Thread Mikael Nilsson via Phabricator via cfe-commits
mikael marked an inline comment as done. mikael added inline comments. Comment at: test/SemaOpenCLCXX/address-space-templates.cl:7 T f1(); // expected-error{{function type may not be qualified with an address space}} - void f2(T); // expected-error{{parameter may not be

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:65 +void UseNodiscardCheck::registerMatchers(MatchFinder *Finder) { + // If we are using C++17 attributes we are going to need c++17 + if (NoDiscardMacro == "[[nodiscard]]") {

[PATCH] D54862: [OpenCL] Add generic AS to 'this' pointer

2018-12-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaType.cpp:3929 +static TypeSourceInfo * +GetFullTypeForDeclarator(TypeProcessingState , QualType declSpecType, + TypeSourceInfo *TInfo, From the `state` you can use

[PATCH] D51554: [CUDA][OPENMP][NVPTX]Improve logic of the debug info support.

2018-12-11 Thread Eric Christopher via Phabricator via cfe-commits
echristo accepted this revision. echristo added a comment. LGTM. I'm quite a bit happier with this now. Thanks for going through the back and forth. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51554/new/ https://reviews.llvm.org/D51554

Re: r348276 - [AST][NFC] Make ArrayTypeTraitExpr non polymorphic

2018-12-11 Thread Mikael Holmén via cfe-commits
Hi, On 12/11/18 5:49 PM, Bruno Ricci wrote: > Hi Mikael, > > I can indeed reproduce this with gcc 5.5.0 when doing a Release > build with assertions. I cannot reproduce this with gcc 6.5.0 > (also with a Release build with assertions), nor can I reproduce > this with clang 7 (also with a Release

[PATCH] D55337: NFC: Move dumpDeclRef to NodeDumper

2018-12-11 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 177670. steveire added a comment. Rebase Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55337/new/ https://reviews.llvm.org/D55337 Files: include/clang/AST/TextNodeDumper.h lib/AST/ASTDumper.cpp

[PATCH] D55428: [Docs] Expand -fstack-protector and -fstack-protector-all info

2018-12-11 Thread Carey Williams via Phabricator via cfe-commits
carwil updated this revision to Diff 177668. carwil added a comment. Make thopre's suggested changes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55428/new/ https://reviews.llvm.org/D55428 Files: include/clang/Driver/Options.td Index: include/clang/Driver/Options.td

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. A few more ideas for enhancements. Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:41 + //bool foo(A*) + // then they may not care about the return value, because of passing data + // via the arguments however functions with no

[PATCH] D55262: [OpenCL] Fix for TBAA information of pointer after addresspacecast

2018-12-11 Thread Romanov Vlad via Phabricator via cfe-commits
romanovvlad added a comment. @Anastasia Could you, please, merge the patch if it's OK with you? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55262/new/ https://reviews.llvm.org/D55262 ___ cfe-commits mailing list

r348834 - Reland r348741 "[Sema] Further improvements to to static_assert diagnostics."

2018-12-11 Thread Clement Courbet via cfe-commits
Author: courbet Date: Tue Dec 11 00:39:11 2018 New Revision: 348834 URL: http://llvm.org/viewvc/llvm-project?rev=348834=rev Log: Reland r348741 "[Sema] Further improvements to to static_assert diagnostics." Fix a dangling reference to temporary, never return nullptr. Modified:

[PATCH] D54592: [analyzer][CStringChecker] evaluate explicit_bzero

2018-12-11 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. Looks good, thanks! Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:2216 + // In this case we just return. + if (StateZeroSize && !StateNonZeroSize) { +

[PATCH] D55566: [analyzer] LiveVariables: Fix a zombie expression problem, add testing infrastructure.

2018-12-11 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 177753. NoQ added a comment. Add documentation, fix checker help message. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55566/new/ https://reviews.llvm.org/D55566 Files: docs/analyzer/DebugChecks.rst include/clang/Analysis/Analyses/LiveVariables.h

[PATCH] D55534: [AST] Store "UsesADL" information in CallExpr.

2018-12-11 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF marked an inline comment as done. EricWF added a comment. I think this is good to go. Any more comments? Comment at: include/clang/Sema/Sema.h:2758 bool AllowExplicit = false, +bool IsADLCandidate = false,

[PATCH] D54921: [analyzer] Remove memoization from RunLoopAutoreleaseLeakChecker

2018-12-11 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Hmm, i think i get it. `Cached` is a reference. Changing `Memoization` will invalidate references because `DenseMap` doesn't provide the respective guarantee. Here's how the code should have looked: ~ 77 Optional Cached = Memoization[C]; ~ 78 if (!Cached) {

[PATCH] D55562: Atomics: support min/max orthogonally

2018-12-11 Thread Tim Northover via Phabricator via cfe-commits
t.p.northover added a comment. > What does it do with floating-point inputs? Same as all the other atomics: run screaming for the hills (or error out, in more reasonable terms). The only way to implement floating atomics in LLVM IR would be with a compare-exchange loop and Clang doesn't expose

[PATCH] D55552: [Sema] Better static assert diagnostics for expressions involving temporaries.

2018-12-11 Thread Clement Courbet via Phabricator via cfe-commits
courbet created this revision. courbet added reviewers: aaron.ballman, Quuxplusone. Herald added a subscriber: cfe-commits. Handles expressions such as: - `std::is_const()` - `std::is_const()()`; - `std::is_same(decltype(U()), V>::value`; Repository: rC Clang https://reviews.llvm.org/D2

[clang-tools-extra] r348840 - [clang-tidy] NFC Consolidate test absl::Time implementation

2018-12-11 Thread Jonas Toth via cfe-commits
Author: jonastoth Date: Tue Dec 11 04:42:17 2018 New Revision: 348840 URL: http://llvm.org/viewvc/llvm-project?rev=348840=rev Log: [clang-tidy] NFC Consolidate test absl::Time implementation Summary: Several tests re-implement these same prototypes (differently), so we can put them in a common

[clang-tools-extra] r348842 - Use the standard Duration factory matcher

2018-12-11 Thread Jonas Toth via cfe-commits
Author: jonastoth Date: Tue Dec 11 04:45:51 2018 New Revision: 348842 URL: http://llvm.org/viewvc/llvm-project?rev=348842=rev Log: Use the standard Duration factory matcher Summary: A new check came in over the weekend; it should use our existing infrastructure for matching `absl::Duration`

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-11 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 177679. MyDeveloperDay marked 10 inline comments as done. MyDeveloperDay added a comment. Resolving some (not all yet) review comments, and looking for help on template parameter exclusion - add additional template argument tests - add additional

[PATCH] D47196: [Time-report ](2): Recursive timers in Clang

2018-12-11 Thread Anton Afanasyev via Phabricator via cfe-commits
anton-afanasyev added a comment. In D47196#1324540 , @Trass3r wrote: > Is this still in progress? AFAIK, this is abandoned by author now. I'm working on other implementation which is similar but with another angle of view. The implementation projected

[PATCH] D55552: [Sema] Better static assert diagnostics for expressions involving temporaries.

2018-12-11 Thread Clement Courbet via Phabricator via cfe-commits
courbet updated this revision to Diff 177681. courbet added a comment. cosmetics Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D2/new/ https://reviews.llvm.org/D2 Files: lib/Sema/SemaTemplate.cpp test/SemaCXX/static-assert.cpp Index:

[PATCH] D55541: Use the standard Duration factory matcher

2018-12-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D55541#1326868 , @lebedev.ri wrote: > In D55541#1326867 , @JonasToth wrote: > > > Please remember to upload your patches with full context (i can highly > > recommend using `arc`, see

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-11 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. I wanted to leave a comment regarding running the [[nodiscard]] checker over all of clang... as requested by @JonasToth, @lebedev.ri and @Szelethus I'm not 100% sure how to present the results, but let me pick out a few high/low lights... My efforts are

[PATCH] D54862: [OpenCL] Add generic AS to 'this' pointer

2018-12-11 Thread Mikael Nilsson via Phabricator via cfe-commits
mikael marked an inline comment as done. mikael added inline comments. Comment at: lib/Sema/SemaType.cpp:5169 +TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator , Scope *S, + const DeclContext *DC) { // Determine the type of the

[PATCH] D54309: [AST] Allow limiting the scope of common AST traversals (getParents, RAV).

2018-12-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. See PR39949 as well, as it seems to trigger the same or a similar problem. @ioeric and @klimek maybe could give an opinion, too? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54309/new/ https://reviews.llvm.org/D54309

[PATCH] D55534: [AST] Store "UsesADL" information in CallExpr.

2018-12-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:2425 CallExpr(const ASTContext , StmtClass SC, unsigned NumPreArgs, - unsigned NumArgs, EmptyShell Empty); + unsigned NumArgs, bool UsesADL, EmptyShell Empty); There

[PATCH] D54309: [AST] Allow limiting the scope of common AST traversals (getParents, RAV).

2018-12-11 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. In D54309#1326852 , @JonasToth wrote: > See PR39949 as well, as it seems to trigger the same or a similar problem. > @ioeric and @klimek maybe could give an opinion, too? Sounds like we might not correctly set the parent map

[PATCH] D55428: [Docs] Expand -fstack-protector and -fstack-protector-all info

2018-12-11 Thread Thomas Preud'homme via Phabricator via cfe-commits
thopre added inline comments. Comment at: include/clang/Driver/Options.td:1636 def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group, HelpText<"Force the usage of stack protectors for all functions">; def fstack_protector_strong : Flag<["-"],

[PATCH] D55544: Warning: objc-encodings-larger-than=

2018-12-11 Thread David Chisnall via Phabricator via cfe-commits
theraven added a comment. It would probably be a good idea to have a similar check on properties, as property encoding strings contain the type encoding (plus extra stuff). I wonder if we also want an option in code generation to replace very long type encodings (or encodings of specifically

Re: r348276 - [AST][NFC] Make ArrayTypeTraitExpr non polymorphic

2018-12-11 Thread Mikael Holmén via cfe-commits
Hi Bruno, I've no idea if this is really related to your change, but with this commit, the following starts crashing: clang-tidy -allow-enabling-analyzer-alpha-checkers -checks='-*,clang-analyzer-*' ./reduced.c -- It seems like it recurses forever for some reason, and then we run out of

<    1   2