[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements

2018-09-05 Thread Mandeep Singh Grang via Phabricator via cfe-commits
mgrang added a comment. In https://reviews.llvm.org/D50488#1224480, @martong wrote: > From this little information I have hear are my thoughts: > > > match callExpr(allOf (callee(functionDecl(hasName("std::sort"))), > > hasArgument(0, > > hasDescendant(declRefExpr(to(fieldDecl(hasNam

[PATCH] D51300: [analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal

2018-09-05 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus planned changes to this revision. Szelethus added a comment. > Sounds like a test case would be great to have. Aye. I'd be good to land this with that testcase. There are a variety of other projects I'm working on (related to the checker), and none of them depend on this patch, so I'l

[PATCH] D51564: Distinguish `__block` variables that are captured by escaping blocks from those that aren't

2018-09-05 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. LGTM. Comment at: include/clang/AST/Decl.h:977 + +unsigned EscapingByref : 1; }; ahatanak wrote: > rjmccall wrote: > > This doesn't actually seem

[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements

2018-09-05 Thread Mandeep Singh Grang via Phabricator via cfe-commits
mgrang updated this revision to Diff 164086. mgrang added a comment. Enabled checker only for C++. https://reviews.llvm.org/D50488 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp te

[PATCH] D51388: [analyzer] NFC: Legalize state manager factory injection.

2018-09-05 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov accepted this revision. george.karpenkov added inline comments. This revision is now accepted and ready to land. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h:33 /// introduce a type named \c NameTy. - /// The macro should n

[PATCH] D51680: [analyzer][UninitializedObjectChecker] New flag to ignore union-like constructs

2018-09-05 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added inline comments. Comment at: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:468 +static bool isUnionLike(const RecordDecl *RD) { + llvm::Regex ContainsKindOrTag("[kK]ind|[tT]ag"); + 1. Since you are using `

[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements

2018-09-05 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. > How then do you think I should try matching the IntPointerArray example? I am > now leaning towards not doing this via AST Matchers as I am not sure if I can > easily match more complex cases. I've sadly reached the end of my knowledge on AST based analysis, but jus

[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements

2018-09-05 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. Why explicitly skip C projects? We would not be able to match `std::X` functions anyway. https://reviews.llvm.org/D50488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailma

[PATCH] D51697: [Sema] Clean up some __builtin_*_chk diagnostics

2018-09-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: aaron.ballman, rsmith. Herald added subscribers: kristina, dexonsmith. Namely, print the likely macro name when it's used, and include the actual computed sizes in the diagnostic message, which are sometimes not obvious. rda

[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements

2018-09-05 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. The code looks fine to me; @mgrang What evaluation steps have you performed? You note there are a few notable false positives, do you have ideas for suppressing those? https://reviews.llvm.org/D50488 ___ cfe-commi

[PATCH] D51300: [analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal

2018-09-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Very easy: 1. Put preprocessed file that crashes into `repro.cpp` (`.c`, `.m`, whatever). 2. Write `repro.sh` as follows: #!/bin/bash blah/blah/path/to/clang -cc1 -analyze -blah-blah-arguments-you-need-to-cause-a-crash repro.cpp 2>&1 | grep "Any assertion message or wh

[PATCH] D51655: [analyzer] Remove traces of ubigraph visualization

2018-09-05 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. I actually thought it's just a different name for graphviz :/ I've definitely never heard of anybody using ubigraph for this purpose. And it's an analyzer-specific feature. Let's remove. https://r

[clang-tools-extra] r341488 - [clang-tidy] minor bug fix to AbseilMatcher.h

2018-09-05 Thread Eric Liu via cfe-commits
Author: ioeric Date: Wed Sep 5 12:01:34 2018 New Revision: 341488 URL: http://llvm.org/viewvc/llvm-project?rev=341488&view=rev Log: [clang-tidy] minor bug fix to AbseilMatcher.h This missing directory is not yet released, but is causing some problems internally. It's gonna be released eventually

r341489 - Add -Wobjc-property-assign-on-object-type.

2018-09-05 Thread John McCall via cfe-commits
Author: rjmccall Date: Wed Sep 5 12:02:00 2018 New Revision: 341489 URL: http://llvm.org/viewvc/llvm-project?rev=341489&view=rev Log: Add -Wobjc-property-assign-on-object-type. This is a warning about using 'assign' instead of 'unsafe_unretained' in Objective-C property declarations. It's off b

[PATCH] D44539: [Sema][Objective-C] Add check to warn when property of objc type has assign attribute

2018-09-05 Thread John McCall via Phabricator via cfe-commits
rjmccall closed this revision. rjmccall added a comment. Committed as r341489. Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r341490 - [Sema] Don't warn about omitting unavailable enum constants in a switch

2018-09-05 Thread Erik Pilkington via cfe-commits
Author: epilk Date: Wed Sep 5 12:13:27 2018 New Revision: 341490 URL: http://llvm.org/viewvc/llvm-project?rev=341490&view=rev Log: [Sema] Don't warn about omitting unavailable enum constants in a switch rdar://42717026 Differential revision: https://reviews.llvm.org/D51649 Added: cfe/trunk

[PATCH] D51649: [Sema] Don't warn about omitting unavailable enum constants in a switch

2018-09-05 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341490: [Sema] Don't warn about omitting unavailable enum constants in a switch (authored by epilk, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-05 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev added inline comments. Comment at: clang-tools-extra/unittests/clangd/DexIndexTests.cpp:623 + + auto I = DexIndex::build(std::move(Builder).build(), URISchemes); + ioeric wrote: > We could use the constructor that doesn't take ownership e.g. > `DexInde

r341491 - Forbid address spaces on compound literals in local scope.

2018-09-05 Thread John McCall via cfe-commits
Author: rjmccall Date: Wed Sep 5 12:22:40 2018 New Revision: 341491 URL: http://llvm.org/viewvc/llvm-project?rev=341491&view=rev Log: Forbid address spaces on compound literals in local scope. Patch by Bevin Hansson! Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/tru

[PATCH] D51426: [Sema] Prohibit function-scope compound literals with address spaces.

2018-09-05 Thread John McCall via Phabricator via cfe-commits
rjmccall closed this revision. rjmccall added a comment. Committed as r341491. https://reviews.llvm.org/D51426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45319: [Atomics] warn about misaligned atomic accesses using libcalls

2018-09-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Herald added a subscriber: jfb. There's still something wrong here: in the cases where we produce these warnings, we still produce calls to `__atomic_*_` library functions. Those functions are specified to only work on properly-aligned inputs, so that's wrong. And there

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/URI.cpp:200 + return make_string_error("Couldn't convert " + AbsolutePath + + " to any given scheme."); +}

[PATCH] D51691: [clangd] NFC: Document URIDistance

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/FileDistance.h:66 // Supports lookups to find the minimum distance to a file from any source. -// This object should be reused

[PATCH] D51676: [clangd] Use TopN instead of std::priority_queue

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Thanks for cleaning this up! I believe this will result in the results from MemIndex being returned in best -> worst order, rather than worst -> best. The contract says callers shouldn't

r341492 - Revert "Enable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)"

2018-09-05 Thread Pavel Labath via cfe-commits
Author: labath Date: Wed Sep 5 13:20:28 2018 New Revision: 341492 URL: http://llvm.org/viewvc/llvm-project?rev=341492&view=rev Log: Revert "Enable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)" This reverts commit r341472 due to breakage in green dragon bots.

Re: r341421 - [ODRHash] Extend hash to support all Type's.

2018-09-05 Thread Galina Kistanova via cfe-commits
Hello Richard, This commit added broken test to one of our builders: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12240 . . . Failing Tests (3): Clang :: Modules/odr_hash.cpp LLVM :: CodeGen/AMDGPU/mubuf-legalize-operands.ll LLVM :: CodeGen/AMDGPU/mu

Re: r341475 - Fix arm_neon.h and arm_fp16.h generation for compiling with std=c89

2018-09-05 Thread Galina Kistanova via cfe-commits
Hello Diogo, This commit added couple of broken tests to one of our builders: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win . . . Failing Tests (5): Clang :: Headers/arm-fp16-header.c Clang :: Headers/arm-neon-header.c . . . Please have a look? The builder was

[PATCH] D51575: [clang-tidy] Implement a clang-tidy check to verify Google Objective-C function naming conventions 📜

2018-09-05 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/google/FunctionNamingCheck.cpp:35 + // non-standard capitalized character sequences including acronyms, + // initialisms, and prefixes of symbols (e.g., UIColorFromNSString). For this + // reason, the regex only verifie

r341496 - Add triple to test case.

2018-09-05 Thread Richard Trieu via cfe-commits
Author: rtrieu Date: Wed Sep 5 14:55:09 2018 New Revision: 341496 URL: http://llvm.org/viewvc/llvm-project?rev=341496&view=rev Log: Add triple to test case. This test uses enums, which have different behavior when targeting different systems. Specifying a triple will give predictable behavior t

Re: r341421 - [ODRHash] Extend hash to support all Type's.

2018-09-05 Thread Richard Trieu via cfe-commits
Galina, Thank you for letting me know. The test case used an enum with default type which has different behavior on Window systems. I've added a triple in r341496 which should fix the test. Richard On Wed, Sep 5, 2018 at 1:45 PM Galina Kistanova wrote: > Hello Richard, > > This commit added

[PATCH] D50947: lambdas in modules: make PendingFakeDefinitionData a set

2018-09-05 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande abandoned this revision. elsteveogrande added inline comments. Comment at: lib/Serialization/ASTReaderDecl.cpp:1760-1765 - if (PFDI != Reader.PendingFakeDefinitionData.end() && - PFDI->second == ASTReader::PendingFakeDefinitionKind::Fake) { + if (PFDI != Rea

[PATCH] D51608: [modules] when deserializing method, ensure it has correct exception spec

2018-09-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I had a look at fixing this, and it... snowballed into a much larger change than I was expecting. I have a patch on the way. Repository: rC Clang https://reviews.llvm.org/D51608 ___ cfe-commits mailing list cfe-commits@li

Re: r341475 - Fix arm_neon.h and arm_fp16.h generation for compiling with std=c89

2018-09-05 Thread Joerg Sonnenberger via cfe-commits
On Wed, Sep 05, 2018 at 02:56:21PM -, Diogo N. Sampaio via cfe-commits wrote: > Author: dnsampaio > Date: Wed Sep 5 07:56:21 2018 > New Revision: 341475 > > URL: http://llvm.org/viewvc/llvm-project?rev=341475&view=rev > Log: > Fix arm_neon.h and arm_fp16.h generation for compiling with std=c

r341498 - Remove unnecessary options from test RUN lines.

2018-09-05 Thread Richard Trieu via cfe-commits
Author: rtrieu Date: Wed Sep 5 15:14:46 2018 New Revision: 341498 URL: http://llvm.org/viewvc/llvm-project?rev=341498&view=rev Log: Remove unnecessary options from test RUN lines. These tests do not check the color printing, so color options should not be used when running them. Modified: c

r341499 - PR38627: Fix handling of exception specification adjustment for

2018-09-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Sep 5 15:30:37 2018 New Revision: 341499 URL: http://llvm.org/viewvc/llvm-project?rev=341499&view=rev Log: PR38627: Fix handling of exception specification adjustment for destructors. We previously tried to patch up the exception specification after completing the class,

[PATCH] D51608: [modules] when deserializing method, ensure it has correct exception spec

2018-09-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Fixed in r341499. Repository: rC Clang https://reviews.llvm.org/D51608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51440: [ToolChains] Link to compiler-rt with -L + -l when possible

2018-09-05 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added a comment. I do prefer the current approach especially on Darwin. Some concerns of switching to use "-L + -l" are: 1. clang and compiler-rt are rev-locked. Inferring the compiler-rt from resource-dir and passing to linker with the full path can prevent mistakes of mixing them u

[PATCH] D51440: [ToolChains] Link to compiler-rt with -L + -l when possible

2018-09-05 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In https://reviews.llvm.org/D51440#1225318, @steven_wu wrote: > I do prefer the current approach especially on Darwin. Some concerns of > switching to use "-L + -l" are: > > 1. clang and compiler-rt are rev-locked. Inferring the compiler-rt from > resource-dir and pa

Re: r335081 - Recommit r335063: [Darwin] Add a warning for missing include path for libstdc++

2018-09-05 Thread Alex L via cfe-commits
Sorry for the late response, On Sat, 18 Aug 2018 at 20:10, Nico Weber wrote: > Also, the diag text should probably say "pass '-stdlib=libc++' " not "pass > '-std=libc++' "? > Good catch, thanks! I'll commit a fixup for it. > > On Sat, Aug 18, 2018 at 11:06 PM Nico Weber wrote: > >> Should th

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-09-05 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 164136. leonardchan added a comment. - Push and pop a new ExpressionEvaluationContext when we enter and exit a compound statement. - Remove Start/StopCheckingNoderef functions since we can now warn whenever we pop Repository: rC Clang https://review

[PATCH] D51713: Support -fno-omit-frame-pointer with -pg.

2018-09-05 Thread Stephen Hines via Phabricator via cfe-commits
srhines created this revision. Herald added a subscriber: cfe-commits. srhines added a subscriber: nickdesaulniers. Previously, any instance of -fomit-frame-pointer would make it such that -pg was an invalid flag combination. If -fno-omit-frame-pointer is passed later on the command line (such tha

[PATCH] D51713: Support -fno-omit-frame-pointer with -pg.

2018-09-05 Thread Stephen Hines via Phabricator via cfe-commits
srhines added a comment. This was discovered in the Android build system (which passes -fomit-frame-pointer by default for ARM configurations. This leads to the inability to specify -pg, since there is no way to override the mere presence of -fomit-frame-pointer. Repository: rC Clang https

[PATCH] D51713: Support -fno-omit-frame-pointer with -pg.

2018-09-05 Thread Stephen Hines via Phabricator via cfe-commits
srhines added a comment. http://b/32510864 was the internal bug request, so I am noting it here for future reference, but I think that the patch itself is pretty self-explanatory (rather than filing a distinct upstream bug about this issue). Repository: rC Clang https://reviews.llvm.org/D51

[PATCH] D50947: lambdas in modules: make PendingFakeDefinitionData a set

2018-09-05 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande abandoned this revision. elsteveogrande added a comment. I'll drop this one, since this is not the logic change we want. Repository: rC Clang https://reviews.llvm.org/D50947 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D51608: [modules] when deserializing method, ensure it has correct exception spec

2018-09-05 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande abandoned this revision. elsteveogrande added a comment. that's great news, thanks! Repository: rC Clang https://reviews.llvm.org/D51608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/

[PATCH] D32577: CMake: Replace open-coded find_package

2018-09-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 164141. tstellar added a comment. Rebase on trunk. Repository: rC Clang https://reviews.llvm.org/D32577 Files: CMakeLists.txt Index: CMakeLists.txt === --- CMakeLists.txt +++ CMakeLists

[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-09-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision. tstellar added reviewers: chandlerc, beanz, mgorny, chapuni. Herald added subscribers: dexonsmith, mehdi_amini. clang currently uses llvm-config to determine the installation paths for llvm's headers and binaries. clang is also using LLVM's cmake files to determine

[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-09-05 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Is LLVM_CONFIG dropped from cache here? I suspect the warning might fire for everyone who has LLVM configured. Repository: rC Clang https://reviews.llvm.org/D51714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D51297: [docs] Create a guide for Vim users on how to setup Clangd

2018-09-05 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. I would stamp this from my side, but concerns whether we should recommend YCM's LSP-based completer instead are probably still there. @sammccall, WDYT? https://reviews.llvm.org/D51297 ___ cfe-commits mailing list cfe-

Re: [clang-tools-extra] r341375 - [clangd] Define a compact binary serialization fomat for symbol slab/index.

2018-09-05 Thread Mikael Holmén via cfe-commits
On 09/05/2018 03:26 PM, Sam McCall wrote: Ah, thanks! Fixed in r341467. I'd guess this was a GCC bug, because GCC >=6 accepts it: https://godbolt.org/z/Yb5gBT Yep works now. Thanks! /Mikael On Wed, Sep 5, 2018 at 2:21 PM Mikael Holmén > wrote: O

r341519 - [DebugInfo] Generate debug information for labels. (Fix PR37395)

2018-09-05 Thread Hsiangkai Wang via cfe-commits
Author: hsiangkai Date: Wed Sep 5 23:03:36 2018 New Revision: 341519 URL: http://llvm.org/viewvc/llvm-project?rev=341519&view=rev Log: [DebugInfo] Generate debug information for labels. (Fix PR37395) Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadat

[PATCH] D51281: [libclang] Return the proper pointee type for 'auto' deduced to pointer

2018-09-05 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan updated this revision to Diff 164151. yvvan added a comment. Comments addressed https://reviews.llvm.org/D51281 Files: test/Index/print-type.cpp tools/libclang/CXType.cpp Index: tools/libclang/CXType.cpp === --- tools/l

<    1   2