[PATCH] D45179: [libc++] Add _LIBCPP_FORCE_NODISCARD define to force-enable nodiscard in pre-C++17

2018-06-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 152587. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Herald added a subscriber: llvm-commits. Right, sorry. Let's try to revive this. Does this test coverage look better? What did i miss? Repository: rL LLVM https://reviews.

[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
modocache created this revision. modocache added reviewers: GorNishanov, EricWF. Add citations to the Coroutines TS to the `isValidCoroutineContext` function, as well as a FIXME and test for [expr.await]p2, which states a co_await expression cannot be used in a default argument. Test Plan: check-

[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added a comment. Also @GorNishanov I'm curious about your two cents on whether comments like these are valuable. If you think they are I may add a few more with post-commit review. Repository: rC Clang https://reviews.llvm.org/D48519

[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added inline comments. Comment at: lib/Sema/SemaCoroutine.cpp:260 else if (MD && MD->isMoveAssignmentOperator()) return DiagInvalid(DiagMoveAssign); + // [basic.start.main]p3: "The function main shall not be a coroutine." @GorNishanov Is there

[PATCH] D47673: [Coroutines] Less IR for noexcept await_resume

2018-06-23 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov accepted this revision. GorNishanov added a comment. This revision is now accepted and ready to land. LGTM with some suggestions. Comment at: lib/CodeGen/CGCoroutine.cpp:224 + bool ResumeCanThrow = true; + if (const auto *MCE = dyn_cast(S.getResumeExpr())) +if

[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov accepted this revision. GorNishanov added a subscriber: rsmith. GorNishanov added a comment. This revision is now accepted and ready to land. LGTM Comment at: lib/Sema/SemaCoroutine.cpp:260 else if (MD && MD->isMoveAssignmentOperator()) return DiagInvalid(Di

[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 152597. modocache added a comment. Great, thanks for the review! I added a reference to N4499. Repository: rC Clang https://reviews.llvm.org/D48519 Files: lib/Sema/SemaCoroutine.cpp test/SemaCXX/coroutines.cpp Index: test/SemaCXX/coroutines.cpp ==

r335419 - Attempt to fix latent tablegen dependency issue

2018-06-23 Thread Reid Kleckner via cfe-commits
Author: rnk Date: Sat Jun 23 10:32:51 2018 New Revision: 335419 URL: http://llvm.org/viewvc/llvm-project?rev=335419&view=rev Log: Attempt to fix latent tablegen dependency issue Modified: cfe/trunk/tools/clang-fuzzer/handle-llvm/CMakeLists.txt Modified: cfe/trunk/tools/clang-fuzzer/handle-ll

r335420 - [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Brian Gesiak via cfe-commits
Author: modocache Date: Sat Jun 23 11:01:02 2018 New Revision: 335420 URL: http://llvm.org/viewvc/llvm-project?rev=335420&view=rev Log: [Sema] isValidCoroutineContext FIXME and citations Summary: Add citations to the Coroutines TS to the `isValidCoroutineContext` function, as well as a FIXME and

[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC335420: [Sema] isValidCoroutineContext FIXME and citations (authored by modocache, committed by ). Changed prior to commit: https://reviews.llvm.org/D48519?vs=152597&id=152598#toc Repository: rC Clan

[PATCH] D47673: [Coroutines] Less IR for noexcept await_resume

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 152599. modocache added a comment. Great, thanks @GorNishanov! I moved the 'can throw' logic into a function called 'memberCallExpressionCanThrow', to convey that some dyn_cast'ing is going on. Repository: rC Clang https://reviews.llvm.org/D47673 Fil

[PATCH] D48521: [analyzer] Highlight STL object destruction in MallocChecker

2018-06-23 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs created this revision. rnkovacs added reviewers: NoQ, xazax.hun, george.karpenkov, dcoughlin. Herald added subscribers: mikhail.ramalho, a.sidorin, dkrupp, szepet, baloghadamsoftware, whisperity. Extend `MallocBugVisitor` to place a note at the point where objects with `AF_InternalBuffe

r335422 - [Coroutines] Less IR for noexcept await_resume

2018-06-23 Thread Brian Gesiak via cfe-commits
Author: modocache Date: Sat Jun 23 11:57:26 2018 New Revision: 335422 URL: http://llvm.org/viewvc/llvm-project?rev=335422&view=rev Log: [Coroutines] Less IR for noexcept await_resume Summary: In his review of https://reviews.llvm.org/D45860, @GorNishanov suggested avoiding generating additional e

[PATCH] D47673: [Coroutines] Less IR for noexcept await_resume

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC335422: [Coroutines] Less IR for noexcept await_resume (authored by modocache, committed by ). Changed prior to commit: https://reviews.llvm.org/D47673?vs=152599&id=152602#toc Repository: rC Clang h

[PATCH] D47673: [Coroutines] Less IR for noexcept await_resume

2018-06-23 Thread Brian Gesiak via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335422: [Coroutines] Less IR for noexcept await_resume (authored by modocache, committed by ). Repository: rL LLVM https://reviews.llvm.org/D47673 Files: cfe/trunk/lib/CodeGen/CGCoroutine.cpp cfe/

[PATCH] D48522: [analyzer] Highlight c_str() call in DanglingInternalBuffer checker

2018-06-23 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs created this revision. rnkovacs added reviewers: NoQ, xazax.hun, george.karpenkov, dcoughlin. Herald added subscribers: mikhail.ramalho, a.sidorin, dkrupp, szepet, baloghadamsoftware, whisperity. Add a bug visitor to `DanglingInternalBuffer` checker that places a note at the point where

[PATCH] D48521: [analyzer] Highlight STL object destruction in MallocChecker

2018-06-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:483 // Did not track -> released. Other state (allocated) -> released. - return (Stmt && (isa(Stmt) || isa(Stmt)) && - (S && S->isReleased()) && (!SPrev || !SPrev->

[PATCH] D48522: [analyzer] Highlight c_str() call in DanglingInternalBuffer checker

2018-06-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Regarding the visitor: Maybe rather than looking at the AST, we should check the states, when we started to track the returned symbol? Using your current design you need to check for the AST twice. Once in the visitor and once in the check. Also, I wonder if this alw

[PATCH] D48522: [analyzer] Highlight c_str() call in DanglingInternalBuffer checker

2018-06-23 Thread Reka Kovacs via Phabricator via cfe-commits
rnkovacs updated this revision to Diff 152604. rnkovacs marked an inline comment as done. rnkovacs added a comment. Um, sorry, I totally forgot about that. Added your case to the tests. https://reviews.llvm.org/D48522 Files: lib/StaticAnalyzer/Checkers/AllocationState.h lib/StaticAnalyzer/C

[PATCH] D48522: [analyzer] Highlight c_str() call in DanglingInternalBuffer checker

2018-06-23 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Looks better, thanks! Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:65 +if (Entry.second == Sym) + Found = true; + } Maybe early return here? https://reviews.llvm.org/D48522 _

[PATCH] D48523: [clang-tidy] Update run-clang-tidy.py with vfsoverlay arg

2018-06-23 Thread Jeremy Demeule via Phabricator via cfe-commits
jdemeule created this revision. jdemeule added a reviewer: alexfh. Herald added subscribers: cfe-commits, xazax.hun. Updating the run-clang-tidy.py script to allow specification of the vfsoverlay argument to the clang-tidy invocation. Repository: rCTE Clang Tools Extra https://reviews.llvm.or

[PATCH] D48524: [ODRHash] Do not put elaborated types in the TypeMap

2018-06-23 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev created this revision. v.g.vassilev added reviewers: rsmith, rtrieu, bruno. Herald added a subscriber: cfe-commits. r332281 (https://reviews.llvm.org/D45463) teaches the ASTContext to generate different elaborated types if there is an owning tag. This exposed a bug with our odr hash

[PATCH] D48460: [analyzer] Fix invalidation on C++ const methods.

2018-06-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Well, i guess that's just one of those mildly infuriating aspects of the AST and/or the standard :) > If references are resolved, why are pointers not? It's kinda understandable. References are simple aliases to glvalues. When you use a reference, you simply get *the* orig

[PATCH] D48522: [analyzer] Highlight c_str() call in DanglingInternalBuffer checker

2018-06-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/AllocationState.h:23-25 +std::unique_ptr +getDanglingBufferBRVisitor(SymbolRef Sym); + I think we should start commenting this stuff up. Like, "This function provides an additional visitor that a

[PATCH] D48522: [analyzer] Highlight c_str() call in DanglingInternalBuffer checker

2018-06-23 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 tho! Comment at: lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp:63-64 + RawPtrMapTy Map = State->get(); + for (const auto Entry : Map) { +

[PATCH] D48521: [analyzer] Highlight STL object destruction in MallocChecker

2018-06-23 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. Only minor nits, as usual :) Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:483 // Did not track -> released. Other state (allocated) -> released. - return (