[PATCH] D43477: [CFG] [analyzer] Add MaterializeTemporaryExpr into the construction context.

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. > eg. `const C &c(123);` or the actual (not the elidable copy) constructor in > `C foo() { return C(123); }` Emm, sry, never mind, forget it, i was trying to say that the reason why we don't have a `CXXBindTemporary` is because we don't have a destructor in class `C`, not

RE: r324991 - Fix for PR32992. Static const classes not exported.

2018-02-19 Thread Ammarguellat, Zahira via cfe-commits
Hans, The reproducer below generates wrong export symbols compared to MSVC but I am not sure it is related to my change. Compiling this with MSVC generates these symbols: ksh-3.2$ dumpbin /directives t3.obj | grep EXPORT /EXPORT:??4?$d@H@@QEAAAEAV0@AEBV0@@Z /EXPORT:??4?$d@H@@QEAAAEA

[PATCH] D43480: [CFG] [analyzer] Add construction context when the constructor is treated like a functional cast.

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet. Herald added subscribers: cfe-commits, rnkovacs. When a constructor with a single argument is treated as a functional cast expression, skip the functional cast while finding the construction

[PATCH] D43481: [CFG] [analyzer] Add construction context when the constructor is being no-op-casted to a const value type.

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet. Herald added subscribers: cfe-commits, rnkovacs. Because lifetime-extended temporaries are treated as const objects, an implicit `NoOp` cast to `const` usually surrounds them in the AST, som

Re: r325475 - [cxx_dr_status] Tests for CWG issues 641-687.

2018-02-19 Thread Galina Kistanova via cfe-commits
Hello Richard, One of modified tests broke the next builder: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/8006 Failing Tests (1): Clang :: CXX/drs/dr6xx.cpp Please have a look? Thanks Galina On Mon, Feb 19, 2018 at 1:05 AM, Richard Smith via cfe-commit

[PATCH] D43483: [CFG] [analyzer] Add construction context when the constructor is on a branch of a ternary operator

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet. Herald added subscribers: cfe-commits, rnkovacs. Similarly to https://reviews.llvm.org/D43480 and https://reviews.llvm.org/D43481, we need to skip the ternary conditional operator `... ? ..

[PATCH] D43487: [mips] Spectre variant two mitigation for MIPSR2

2018-02-19 Thread Simon Dardis via Phabricator via cfe-commits
sdardis created this revision. sdardis added a reviewer: atanasyan. Herald added a subscriber: arichardson. This patch provides migitation for CVE-2017-5715, Spectre variant two, which affects the https://reviews.llvm.org/P5600 and https://reviews.llvm.org/P6600. It provides the option -mindirect

r325540 - Fix test failure on target where size_t is long long.

2018-02-19 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Feb 19 14:50:50 2018 New Revision: 325540 URL: http://llvm.org/viewvc/llvm-project?rev=325540&view=rev Log: Fix test failure on target where size_t is long long. Modified: cfe/trunk/test/CXX/drs/dr6xx.cpp Modified: cfe/trunk/test/CXX/drs/dr6xx.cpp URL: http://llvm.o

Re: r325475 - [cxx_dr_status] Tests for CWG issues 641-687.

2018-02-19 Thread Richard Smith via cfe-commits
Fixed in r325540. Sorry about that. On 19 February 2018 at 14:44, Galina Kistanova via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Hello Richard, > > One of modified tests broke the next builder: > http://lab.llvm.org:8011/builders/llvm-clang-x86_64- > expensive-checks-win/builds/8006 > >

[PATCH] D43483: [CFG] [analyzer] Add construction context when the constructor is on a branch of a ternary operator

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 134979. NoQ added a comment. Fix the test. https://reviews.llvm.org/D43483 Files: lib/Analysis/CFG.cpp test/Analysis/cfg-rich-constructors.cpp test/Analysis/temp-obj-dtors-cfg-output.cpp Index: test/Analysis/temp-obj-dtors-cfg-output.cpp

[PATCH] D40218: [Clang] Add __builtin_launder

2018-02-19 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 134986. EricWF added a comment. Ping. https://reviews.llvm.org/D40218 Files: include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.td lib/AST/ExprConstant.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaChecking.cpp test/CodeGen/bui

[PATCH] D43047: [Builtins] Overload __builtin_operator_new/delete to allow forwarding to usual allocation/deallocation functions.

2018-02-19 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 134989. EricWF added a comment. Ping. https://reviews.llvm.org/D43047 Files: include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/CodeGen/CGBuiltin.cpp lib/CodeGen/CGExprCXX.cpp lib/CodeGen/Cod

[PATCH] D37035: Implement __builtin_LINE() et. al. to support source location capture.

2018-02-19 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 134987. EricWF added a comment. Ping. https://reviews.llvm.org/D37035 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/AST/SourceLocExprScope.h include/c

[PATCH] D43494: [Modules] Fix creating fake definition data for lambdas.

2018-02-19 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai created this revision. vsapsai added reviewers: rsmith, bruno. Herald added a subscriber: jkorous-apple. During reading C++ definition data for lambda we can access CXXRecordDecl representing lambda before we finished reading the definition data. This can happen by reading a captured varia

[PATCH] D34365: [FrontEnd] Allow overriding the default C/C++ -std via CMake vars

2018-02-19 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. Is there a need for this given the changes for 6.0? https://reviews.llvm.org/D34365 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43494: [Modules] Fix creating fake definition data for lambdas.

2018-02-19 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:2969 +if (!DD && RD->isBeingDefined()) + return nullptr; Perhaps add a comment explaining what's going on in this early exit? https://reviews.llvm.org/D43494

[PATCH] D43322: Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

2018-02-19 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone updated this revision to Diff 134999. Quuxplusone edited the summary of this revision. Repository: rC Clang https://reviews.llvm.org/D43322 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaExprC

[PATCH] D43322: Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

2018-02-19 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. @rsmith and/or @rtrieu, please take another look? All my TODOs are done now: there are fixits, and the wording of the diagnostic changes if it's a "throw" instead of a "return", and the wording has been updated per Richard Smith's suggestions. I have one very mino

[PATCH] D43497: [analyzer] Introduce correct lifetime extension behavior in simple cases.

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet. Herald added subscribers: cfe-commits, rnkovacs. This patch uses the reference to `MaterializeTemporaryExpr` stored in the construction context since https://reviews.llvm.org/D43477 in order

[PATCH] D42755: [libcxx] Fix last_write_time tests for filesystems that don't support very small times.

2018-02-19 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 135003. vsapsai added a comment. Herald added a subscriber: christof. - Add back existing test but run it only when file system supports min time. https://reviews.llvm.org/D42755 Files: libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write

r325544 - [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

2018-02-19 Thread Eugene Zelenko via cfe-commits
Author: eugenezelenko Date: Mon Feb 19 18:16:28 2018 New Revision: 325544 URL: http://llvm.org/viewvc/llvm-project?rev=325544&view=rev Log: [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). Modified: cfe/trunk/include/clang/Sema/AttributeList.h

r325545 - Fix some -Wexceptions false positives.

2018-02-19 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Feb 19 18:32:30 2018 New Revision: 325545 URL: http://llvm.org/viewvc/llvm-project?rev=325545&view=rev Log: Fix some -Wexceptions false positives. Reimplement the "noexcept function actually throws" warning to properly handle nested try-blocks. In passing, change 'throw;'

[PATCH] D42645: New simple Checker for mmap calls

2018-02-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. I believe we should relocate this checker into `alpha.security` in order to indicate that this is still in development, so that you (or anyone else) could provide auto-detection for the macro values later as an incremental improvement, and then it will be back in `security`

[PATCH] D43273: [libcxx] [test] Fix MSVC warnings and errors.

2018-02-19 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added inline comments. Comment at: test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp:80 { std::vector v(10); std::iota(v.begin(), v.end(), 1); What if we just made the containers `vector` ? (and `triangle`) https:

[PATCH] D43322: Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

2018-02-19 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone updated this revision to Diff 135005. Quuxplusone added a comment. Removed a redundant check for LValueReferenceType in the CWG1579 codepath. (In that branch, we know that standard C++ *did* perform the copy-to-move transformation, so obviously we can't have had an lvalue reference t

[PATCH] D41102: Setup clang-doc frontend framework

2018-02-19 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett added inline comments. Comment at: clang-doc/ClangDoc.cpp:32 + ECtx.reportResult( + Name, Mapper.emitInfo(D, getComment(D), Name, getLine(D), getFile(D))); +} lebedev.ri wrote: > I wonder if `Name` should be `std::move()`'d ? Or not, `reportRes

[PATCH] D41102: Setup clang-doc frontend framework

2018-02-19 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett updated this revision to Diff 135009. juliehockett marked 27 inline comments as done. juliehockett added a comment. 1. Decoupled the mapper implementation from the main program, exposing only the function to generate the action factory 2. Implemented the matchers into a RecursiveASTV

r325553 - [Sema] Fix -Wunused-variable

2018-02-19 Thread Sam McCall via cfe-commits
Author: sammccall Date: Mon Feb 19 23:21:56 2018 New Revision: 325553 URL: http://llvm.org/viewvc/llvm-project?rev=325553&view=rev Log: [Sema] Fix -Wunused-variable Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp URL: http://llvm

r325560 - [X86] Remove mask from 512 bit pmulhrsw/pmulhw/pmulhuw builtins.

2018-02-19 Thread Craig Topper via cfe-commits
Author: ctopper Date: Mon Feb 19 23:28:18 2018 New Revision: 325560 URL: http://llvm.org/viewvc/llvm-project?rev=325560&view=rev Log: [X86] Remove mask from 512 bit pmulhrsw/pmulhw/pmulhuw builtins. We now use a vselect node in IR around an unmasked builtin. This makes it consistent with the 128

[PATCH] D43500: modernize-use-default-member-init: Remove trailing comma and colon.

2018-02-19 Thread Jeremy Demeule via Phabricator via cfe-commits
jdemeule created this revision. jdemeule added a reviewer: alexfh. Herald added subscribers: cfe-commits, mgorny. 'modernize-user-default-member-init' does not automatically ask to remove comma and colon when replacements are produced. It seems, when they are apply directly from clang-tidy, the

[PATCH] D41102: Setup clang-doc frontend framework

2018-02-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-doc/ClangDocBinary.cpp:72 + assert(Abbrevs.find(recordID) == Abbrevs.end() && + "Abbreviation already set."); + Abbrevs[recordID] = abbrevID; juliehockett wrote: > lebedev.ri wrote: > > lebedev.ri wrot

<    1   2