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

2018-12-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:22 + +// Find a better way of detecting const-reference-template type +// parameters via using alias not detected by ``isTemplateTypeParamType()``. You can write `TODO: ` or `F

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D55650#1329692 , @kadircet wrote: > I think the description is misleading, you are saying that we were triggering > an assertion and you are fixing that. But in reality, we were not triggering > any assertions, this patch is ad

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 178203. hokein marked 5 inline comments as done. hokein added a comment. Keep the old behavior. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55650/new/ https://reviews.llvm.org/D55650 Files: clangd/index/Back

[PATCH] D55697: [analyzer] Assume that we always have a SubEngine available

2018-12-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: NoQ, george.karpenkov. xazax.hun added a project: clang. Herald added subscribers: gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity. I was stumbled upon some checks wh

[PATCH] D55697: [analyzer] Assume that we always have a SubEngine available

2018-12-14 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. We could also add an assert to getOwningEngine I guess. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55697/new/ https://reviews.llvm.org/D55697 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D55698: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function

2018-12-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: rnk, majnemer. This matches what GCC does in these situations. This fixes compiling Qt in debug mode. In release mode, references to the vtable of this particular class ends up optimized away, but in debug mode, the compiler creates refe

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. Ah you are right, the Optional.. Thanks! Comment at: clangd/index/Background.cpp:384 Action->EndSourceFile(); + if (Clang->hasDiagnostics() && + Clang->getDiagnostics().hasUncompilableErrorOccurred()) { Then don't need to keep

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/index/Background.cpp:384 Action->EndSourceFile(); + if (Clang->hasDiagnostics() && + Clang->getDiagnostics().hasUncompilableErrorOccurred()) { kadircet wrote: > The

[libunwind] r349140 - [AArch64][libunwind] Unwinding support for return address signing

2018-12-14 Thread Luke Cheeseman via cfe-commits
Author: lukecheeseman Date: Fri Dec 14 03:30:12 2018 New Revision: 349140 URL: http://llvm.org/viewvc/llvm-project?rev=349140&view=rev Log: [AArch64][libunwind] Unwinding support for return address signing - Follow up to revision r342895 - gcc would not build libunwind with the earlier patch as t

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clangd/index/Background.cpp:384 Action->EndSourceFile(); + if (Clang->hasDiagnostics() && + Clang->getDiagnostics().hasUncompilableErro

[PATCH] D55701: [analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore

2018-12-14 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl created this revision. r.stahl added reviewers: NoQ, dcoughlin, george.karpenkov. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. The LocationE parameter of evalStore is documented as "The location ex

[PATCH] D55701: [analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore

2018-12-14 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added a comment. cfe-dev thread with short discussion: http://lists.llvm.org/pipermail/cfe-dev/2018-April/057562.html Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55701/new/ https://reviews.llvm.org/D55701

[PATCH] D46421: [analyzer][CrossTU] Extend CTU to VarDecls with initializer

2018-12-14 Thread Rafael Stahl via Phabricator via cfe-commits
r.stahl added a comment. Herald added subscribers: dkrupp, donat.nagy, Szelethus, mikhail.ramalho, baloghadamsoftware. Please let me know if there is anything else that should be addressed. Note that even though this diff is quite large, most is just renaming things to stay consistent. CHANGE

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

2018-12-14 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 178217. MyDeveloperDay marked 2 inline comments as done. MyDeveloperDay added a comment. Fix review comments - minor changes to code comments - add more unit tests for typedef'd template types CHANGES SINCE LAST ACTION https://reviews.llvm.org/D554

[PATCH] D55702: [clangd] Fix memory leak in ClangdTests.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. createInvocationFromCommandLine sets DisableFree to true by default, which leads memory leak in clangd. The fix is to use the `BuildCompilationInvocation`

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a comment. Thanks for the review. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55650/new/ https://reviews.llvm.org/D55650 ___ cfe-commits mailing l

[clang-tools-extra] r349144 - [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Haojian Wu via cfe-commits
Author: hokein Date: Fri Dec 14 04:39:08 2018 New Revision: 349144 URL: http://llvm.org/viewvc/llvm-project?rev=349144&view=rev Log: [clangd] Fix an assertion failure in background index. Summary: When indexing a file which contains an uncompilable error, we will trigger an assertion failure -- t

[PATCH] D55650: [clangd] Fix an assertion failure in background index.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL349144: [clangd] Fix an assertion failure in background index. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://revi

[PATCH] D55702: [clangd] Fix memory leak in ClangdTests.

2018-12-14 Thread David Stenberg via Phabricator via cfe-commits
dstenb added a comment. With this patch applied we don't see any issues on our end. Thanks for the help! Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55702/new/ https://reviews.llvm.org/D55702 ___ cfe-

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

2018-12-14 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay marked 7 inline comments as done. MyDeveloperDay added inline comments. Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:25 +static bool isAliasedTemplateParamType(const QualType &ParamType) { + return (ParamType.getCanonicalType().getAsString().find("type-p

[PATCH] D55698: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function

2018-12-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 178222. mstorsjo added a comment. Fixed wrapping of the RUN line in the test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55698/new/ https://reviews.llvm.org/D55698 Files: lib/Sema/SemaDeclCXX.cpp test/CodeGenCXX/dllexport-missing-key.cpp

[PATCH] D55702: [clangd] Fix memory leak in ClangdTests.

2018-12-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55702/new/ https://reviews.llvm.org/D55702 ___

[clang-tools-extra] r349145 - [clangd] Fix memory leak in ClangdTests.

2018-12-14 Thread Haojian Wu via cfe-commits
Author: hokein Date: Fri Dec 14 05:19:38 2018 New Revision: 349145 URL: http://llvm.org/viewvc/llvm-project?rev=349145&view=rev Log: [clangd] Fix memory leak in ClangdTests. Summary: createInvocationFromCommandLine sets DisableFree to true by default, which leads memory leak in clangd. The fix is

[PATCH] D55702: [clangd] Fix memory leak in ClangdTests.

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL349145: [clangd] Fix memory leak in ClangdTests. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/LanguageExtensions.rst:2667 +Because multiple push directives can be nested, if you're writing a macro that +expands to ``_Pragma("clang attribute")`` it's good hygiene to add a label to +your push/pop directives. A pop

[PATCH] D46421: [analyzer][CrossTU] Extend CTU to VarDecls with initializer

2018-12-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Sorry for the delay. The changes are looking good to me, although I think it might be worth to split this up into two patch, one NFC with the renaming, and one that actually introduces the changes. @martong could you also take a look? First, we would also like to tes

[PATCH] D55654: [clang] [Driver] [NetBSD] Add -D_REENTRANT when using sanitizers

2018-12-14 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. Please normalize the description to resemble a typical commit message. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55654/new/ https://reviews.llvm.org/D55654 ___ cfe-commits mailing lis

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

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/AST/Stmt.h:847 + const ASTContext *Context = nullptr, + bool PrintCanonicalTypes = false) const; I'm pretty wary of long lists of parameters that include booleans

[PATCH] D53713: Add extension to always default-initialize nullptr_t.

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: NoQ, george.karpenkov. aaron.ballman added a comment. Adding some reviewers for the static analyzer questions raised. I think this is a reasonable approach, but are there situations where we should diagnose this as an extension? I can't think of one, but I figured

[clang-tools-extra] r349148 - [clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.

2018-12-14 Thread Haojian Wu via cfe-commits
Author: hokein Date: Fri Dec 14 05:49:00 2018 New Revision: 349148 URL: http://llvm.org/viewvc/llvm-project?rev=349148&view=rev Log: [clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC. Modified: clang-tools-extra/trunk/unittests/clangd/HeadersTests.cpp Modified: clang-too

[clang-tools-extra] r349150 - clang-include-fixer.el: support remote files

2018-12-14 Thread Philipp Stephani via cfe-commits
Author: phst Date: Fri Dec 14 05:56:05 2018 New Revision: 349150 URL: http://llvm.org/viewvc/llvm-project?rev=349150&view=rev Log: clang-include-fixer.el: support remote files Summary: Support remote files (e.g., Tramp) in the Emacs integration for clang-include-fixer Reviewers: klimek Reviewe

[PATCH] D54672: clang-include-fixer.el: support remote files

2018-12-14 Thread Philipp via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE349150: clang-include-fixer.el: support remote files (authored by phst, committed by ). Changed prior to commit: https://reviews.llvm.org/D54672?vs=174522&id=178227#toc Repository: rCTE Clang Tools

[PATCH] D55705: [dexp] Change FuzzyFind to also print scope of symbols

2018-12-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: hokein. Herald added subscribers: cfe-commits, arphaman, jkorous, ioeric, ilya-biryukov. When there are multiple symbols in the result of a fuzzy find with the same name, one has to perform an additional query to figure out which of those

[PATCH] D55044: [clang-tidy] check for Abseil make_unique

2018-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. >> In D55044#1329604 , @hokein wrote: >> In fact, the existing modernize-make-unique can be configured to support >> absl::make_unique, you'd just need to configure the check option >> MakeSmartPtrFunction to absl::make_unique (th

[clang-tools-extra] r349152 - [dexp] Change FuzzyFind to also print scope of symbols

2018-12-14 Thread Kadir Cetinkaya via cfe-commits
Author: kadircet Date: Fri Dec 14 06:17:18 2018 New Revision: 349152 URL: http://llvm.org/viewvc/llvm-project?rev=349152&view=rev Log: [dexp] Change FuzzyFind to also print scope of symbols Summary: When there are multiple symbols in the result of a fuzzy find with the same name, one has to perfo

[PATCH] D55705: [dexp] Change FuzzyFind to also print scope of symbols

2018-12-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL349152: [dexp] Change FuzzyFind to also print scope of symbols (authored by kadircet, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://re

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:7 + +#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} +#pragma clang attribute pop NOT_MY_LABEL // expected-error{

[PATCH] D55658: Avoid Decl::getASTContext in hot paths where possible, Part 1

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: rsmith. aaron.ballman added a subscriber: rsmith. aaron.ballman added a comment. I'd like @rsmith's opinion on whether this is a good churn or not. I think it's mostly reasonable, but it's also a lot of changes for identical behavior and in some cases the changes

[PATCH] D55382: Make -Wstring-plus-int warns even if when the result is not out of bounds

2018-12-14 Thread Arnaud Bienner via Phabricator via cfe-commits
ArnaudBienner added a comment. Really sorry about breaking the build :( Thanks for reverting it. Actually, I think we could fix that test by removing the " +1": AFAICT this test is checking that warnings are correctly emitted from clang, but not testing all the warnings. So the conversion from c

r349155 - Implement -frecord-command-line (-frecord-gcc-switches)

2018-12-14 Thread Scott Linder via cfe-commits
Author: scott.linder Date: Fri Dec 14 07:38:15 2018 New Revision: 349155 URL: http://llvm.org/viewvc/llvm-project?rev=349155&view=rev Log: Implement -frecord-command-line (-frecord-gcc-switches) Implement options in clang to enable recording the driver command-line in an ELF section. Implement a

[PATCH] D54489: Implement -frecord-command-line (-frecord-gcc-switches)

2018-12-14 Thread Scott Linder via Phabricator via cfe-commits
scott.linder closed this revision. scott.linder added a comment. rL349155 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54489/new/ https://reviews.llvm.org/D54489 ___ cfe-commits mailing list cfe-commits@

[PATCH] D46421: [analyzer][CrossTU] Extend CTU to VarDecls with initializer

2018-12-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Hi Rafael, This is a great patch and good improvement, thank you! I had a few minor comments. (Also, I was thinking about what else could we import in the future, maybe definitions of C++11 enum classes would be also worth to be handled by CTU.) Comm

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:7 + +#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} +#pragma clang attribute pop NOT_MY_LABEL // expected-err

[PATCH] D55658: Avoid Decl::getASTContext in hot paths where possible, Part 1

2018-12-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Just to expend on the instrumentation results: The measurement was done with all of Boost. I would take the estimation of the time wasted with a grain of salt since this is just `num_iterations * 10ns` which is obviously a very rough estimation. However on my machine

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: NoQ, george.karpenkov. This updates our SARIF support from 10-10 to 11-28. Functional changes include: - The run.files property is now an array instead of a mapping. - fileLocation objects now have a fileIndex property specifying

[PATCH] D54565: Introduce `-Wctad` as a subgroup of `-Wc++14-compat`

2018-12-14 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. @rsmith ping! @thakis: You said, //"From a user point of view, I have no idea what "CTAD" means, and I sometimes work on a C++ compiler."// Did you mean "I think the command-line option should be named something more verbose than `-W[c++14-compat-]ctad`"? Or "I don

[PATCH] D47344: LWG 2843 "Unclear behavior of std::pmr::memory_resource::do_allocate()"

2018-12-14 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. @EricWF ping! Repository: rCXX libc++ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D47344/new/ https://reviews.llvm.org/D47344 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D42682: [clang-tidy] Add io-functions-misused checker

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/bugprone/IoFunctionsCheck.cpp:47-49 + "consider to cast the return value of %0 from type integer to type char, " + "possible loss of precision if an error has occurred or the end " + "of file has been rea

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-14 Thread Simon Marchi via Phabricator via cfe-commits
simark added a comment. In D55363#1329652 , @ilya-biryukov wrote: > Sorry if I missed any important design discussions here, but wanted to clear > up what information we are trying to convey to the user with the status > messages? > E.g. why seeing "bu

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

2018-12-14 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner updated this revision to Diff 178242. cpplearner marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55413/new/ https://reviews.llvm.org/D55413 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/constant-expression-cxx1y.cpp Index: clang

[PATCH] D55710: add pragmas to control Software Pipelining optimisation

2018-12-14 Thread Alexey Lapshin via Phabricator via cfe-commits
alexey.lapshin created this revision. alexey.lapshin added reviewers: bcahoon, kparzysz, aaron.ballman, arphaman, rsmith, marksl, yakush. Herald added a subscriber: zzheng. [PIPELINER] add two pragmas to control Software Pipelining optimisation. #pragma clang loop pipeline(disable)

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked an inline comment as done. erik.pilkington added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:7 + +#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} +#pra

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

2018-12-14 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner marked 2 inline comments as done. cpplearner added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:3453 Value) && handleFloatFloatBinOp(Info, E, Value, Opcode, RHS.getFloat()) && HandleFloatToFloatC

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked an inline comment as done. aaron.ballman added inline comments. Comment at: lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:218 const PathDiagnosticLocation &P = Piece->getLocation(); +const auto *CP = dyn_cast(Piece.get()); Locations.push_back(cre

[PATCH] D55712: [Driver][PS4] Do not implicitly link against asan or ubsan if -nostdlib or -nodefaultlibs on PS4.

2018-12-14 Thread pierre gousseau via Phabricator via cfe-commits
pgousseau created this revision. pgousseau added reviewers: filcab, probinson, rsmith, gbedwell, dmikulin. Herald added a subscriber: cfe-commits. NFC for targets other than PS4. Respect -nostdlib and -nodefaultlibs when enabling asan or ubsan. Repository: rC Clang https://reviews.llvm.org/D

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 178254. erik.pilkington marked 7 inline comments as done. erik.pilkington added a comment. Address @aaron.ballman comments. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55628/new/ https://reviews.llvm.org/D55628 Files: clang/docs

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/docs/LanguageExtensions.rst:2667 +Because multiple push directives can be nested, if you're writing a macro that +expands to ``_Pragma("clang attribute")`` it's good hygiene to add a label to +your push/pop directives. A po

[PATCH] D50563: Fixed frontend clang tests in windows read-only container

2018-12-14 Thread Stella Stamenova via Phabricator via cfe-commits
stella.stamenova requested changes to this revision. stella.stamenova added inline comments. This revision now requires changes to proceed. Comment at: test/Frontend/output-failures.c:1 -// RUN: not %clang_cc1 -emit-llvm -o %S/doesnotexist/somename %s 2> %t -// RUN: FileCheck -ch

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. erichkeane added reviewers: zturner, majnemer, compnerd, rnk. Herald added subscribers: erik.pilkington, Anastasia. All of the symbols demangle on llvm-undname and demangler.com. This address space qualifier is useful for when we want to use opencl C++ in Windows

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

2018-12-14 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. Thanks, that looks good to me. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55413/new/ https://reviews.llvm.org/D55413 ___ cfe-comm

[PATCH] D55658: Avoid Decl::getASTContext in hot paths where possible, Part 1

2018-12-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 178259. riccibruno marked 3 inline comments as done. riccibruno added a comment. Addressed inline comments Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55658/new/ https://reviews.llvm.org/D55658 Files: include/clang/AS

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Zachary Turner via Phabricator via cfe-commits
zturner added a comment. It would be interesting to teach `llvm-undname` to demangle this more naturally. Right for this mangling: `?f1@@YAXPEAU?$AS_@$00$$CBD@__clang@@@Z` I see this demangling: `void __cdecl f1(struct __clang::AS_<1, char const> *)`. That's an accurate representation of the

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: test/CodeGenCXX/mangle-address-space.cpp:7 +// CHECKNOOCL-LABEL: define {{.*}}void @_Z2f0Pc +// WINNOOCL-LABEL: define {{.*}}void @"?f0@@YAXPEAD@Z" +// CHECKOCL-LABEL: define {{.*}}void @_Z2f0PU9CLgenericc You know, now that

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 4 inline comments as done. erichkeane added inline comments. Comment at: test/CodeGenCXX/mangle-address-space.cpp:7 +// CHECKNOOCL-LABEL: define {{.*}}void @_Z2f0Pc +// WINNOOCL-LABEL: define {{.*}}void @"?f0@@YAXPEAD@Z" +// CHECKOCL-LABEL: define {{.*}}void @_Z

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 2 inline comments as done. erichkeane added inline comments. Comment at: test/CodeGenOpenCL/address-spaces-mangling.cl:7 +// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple x86_64-windows-pc -emit-llvm -o - | FileCheck -che

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:1806-1836 +Extra.mangleSourceName("AS_"); +Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(TargetAS), + /*IsBoolean*/ false); + } else { +switch (AS) { +def

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:7 + +#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} +#pragma clang attribute pop NOT_MY_LABEL // expected-error{

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:1806-1836 +Extra.mangleSourceName("AS_"); +Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(TargetAS), + /*IsBoolean*/ false); + } else { +switch (AS) { +default:

[PATCH] D46421: [analyzer][CrossTU] Extend CTU to VarDecls with initializer

2018-12-14 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In D46421#1121080 , @r.stahl wrote: > It seems like a good idea to not do that, since non-const values are not > used. It might become useful if we ever do some kind of straight line > execution from static initialization to main. >

[PATCH] D55698: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function

2018-12-14 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:5754-5756 + if (ClassExported && + Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) +MarkVTableUsed(Class->getLocation(), Class, true); This may be too early, you can get into

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:15 +// Out of order! +#pragma clang attribute pop MY_LABEL + dexonsmith wrote: > erik.pilkington wrote: > > aaron.ballman wrote: > > > dexonsmith wrote: > > > > aaron.ballma

[PATCH] D55710: add pragmas to control Software Pipelining optimisation

2018-12-14 Thread Alexey Lapshin via Phabricator via cfe-commits
alexey.lapshin updated this revision to Diff 178264. alexey.lapshin added a comment. deleted small typo in CGLoopInfo.cpp CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55710/new/ https://reviews.llvm.org/D55710 Files: include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td in

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 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. Yup, looks good, and i keep passively cheering for this project to be successful. Comment at: lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:129 + unsigned Index = 0; + for (const

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 4 inline comments as done. aaron.ballman added inline comments. Comment at: lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:129 + unsigned Index = 0; + for (const json::Value &File : Files) { +if (const json::Object *Obj = File.getAsObject()) { ---

r349188 - Update our SARIF support from 10-10 to 11-28.

2018-12-14 Thread Aaron Ballman via cfe-commits
Author: aaronballman Date: Fri Dec 14 12:34:23 2018 New Revision: 349188 URL: http://llvm.org/viewvc/llvm-project?rev=349188&view=rev Log: Update our SARIF support from 10-10 to 11-28. Functional changes include: * The run.files property is now an array instead of a mapping. * fileLocation objec

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. Committed in r349188. (@NoQ -- if you'd like to see a switch to `llvm::find_if()`, I'm happy to handle it post-commit.) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55707/new/ https://reviews.llvm.org/D55707 __

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/SemaChecking.cpp:7725-7726 +return true; + // Look through vector types, since we do default argument promotion for + // those in OpenCL. + if (const ExtVectorType *VecTy = From->getAs()) Looking at

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Sure, np. Comment at: lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:129 + unsigned Index = 0; + for (const json::Value &File : Files) { +if (const json::Object *Obj = File.getAsObject()) { aaron.ballman wrote: > NoQ wrote: > > This sou

[PATCH] D53713: Add extension to always default-initialize nullptr_t.

2018-12-14 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 approve this for Static Analyzer. As long as this is the correct thing to do in the compiler, Static Analyzer should ideally behave similarly to the compiler. Exposing portability bugs that would

r349190 - [analyzer] MoveChecker: Improve invalidation policies.

2018-12-14 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Dec 14 12:47:58 2018 New Revision: 349190 URL: http://llvm.org/viewvc/llvm-project?rev=349190&view=rev Log: [analyzer] MoveChecker: Improve invalidation policies. If a moved-from object is passed into a conservatively evaluated function by pointer or by reference, we a

[PATCH] D55289: [analyzer] MoveChecker Pt.5: Improve invalidation policies.

2018-12-14 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC349190: [analyzer] MoveChecker: Improve invalidation policies. (authored by dergachev, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55289/new/ https://rev

r349191 - [analyzer] MoveChecker Pt.6: Suppress the warning for the move-safe STL classes.

2018-12-14 Thread Artem Dergachev via cfe-commits
Author: dergachev Date: Fri Dec 14 12:52:57 2018 New Revision: 349191 URL: http://llvm.org/viewvc/llvm-project?rev=349191&view=rev Log: [analyzer] MoveChecker Pt.6: Suppress the warning for the move-safe STL classes. Some C++ standard library classes provide additional guarantees about their stat

[PATCH] D55307: [analyzer] MoveChecker Pt.6: Suppress the warning for the few move-safe STL classes.

2018-12-14 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC349191: [analyzer] MoveChecker Pt.6: Suppress the warning for the move-safe STL classes. (authored by dergachev, committed by ). Changed prior to commit: https://reviews.llvm.org/D55307?vs=177048&id=178

[PATCH] D55307: [analyzer] MoveChecker Pt.6: Suppress the warning for the few move-safe STL classes.

2018-12-14 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked 2 inline comments as done. NoQ added inline comments. Comment at: test/Analysis/Inputs/system-header-simulator-cxx.h:782 +namespace std { + template // TODO: Implement the stub for deleter. + class unique_ptr { a_sidorin wrote: > Nit: our coding rule

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:15 +// Out of order! +#pragma clang attribute pop MY_LABEL + aaron.ballman wrote: > dexonsmith wrote: > > erik.pilkington wrote: > > > aaron.ballman wrote: > > > > dexonsmith w

r349192 - [OPENMP][NVPTX]Improved interwarp copy function.

2018-12-14 Thread Alexey Bataev via cfe-commits
Author: abataev Date: Fri Dec 14 13:00:58 2018 New Revision: 349192 URL: http://llvm.org/viewvc/llvm-project?rev=349192&view=rev Log: [OPENMP][NVPTX]Improved interwarp copy function. Inlined runtime with the current implementation of the interwarp copy function leads to the undefined behavior bec

[PATCH] D40218: [Clang] Add __builtin_launder

2018-12-14 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 178267. EricWF added a comment. Merging with upstream. Preparing to commit. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D40218/new/ https://reviews.llvm.org/D40218 Files: include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.

[PATCH] D40218: [Clang] Add __builtin_launder

2018-12-14 Thread Eric Fiselier via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC349195: [Clang] Add __builtin_launder (authored by EricWF, committed by ). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D40218/new/ https://reviews.llvm.org/D40218 Files:

r349195 - [Clang] Add __builtin_launder

2018-12-14 Thread Eric Fiselier via cfe-commits
Author: ericwf Date: Fri Dec 14 13:11:28 2018 New Revision: 349195 URL: http://llvm.org/viewvc/llvm-project?rev=349195&view=rev Log: [Clang] Add __builtin_launder Summary: This patch adds `__builtin_launder`, which is required to implement `std::launder`. Additionally GCC provides `__builtin_lau

[PATCH] D55707: Update to SARIF 11-28

2018-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked an inline comment as done. aaron.ballman added inline comments. Comment at: lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:129 + unsigned Index = 0; + for (const json::Value &File : Files) { +if (const json::Object *Obj = File.getAsObject()) { ---

r349197 - Using llvm::find_if() instead of a range-based for loop; NFC.

2018-12-14 Thread Aaron Ballman via cfe-commits
Author: aaronballman Date: Fri Dec 14 13:14:44 2018 New Revision: 349197 URL: http://llvm.org/viewvc/llvm-project?rev=349197&view=rev Log: Using llvm::find_if() instead of a range-based for loop; NFC. This addresses post-commit review feedback from r349188. Modified: cfe/trunk/lib/StaticAnal

[PATCH] D55387: [analyzer] MoveChecker Pt.7: NFC: Misc refactoring.

2018-12-14 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 178272. NoQ marked 4 inline comments as done. NoQ added a comment. Fxd. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55387/new/ https://reviews.llvm.org/D55387 Files: lib/StaticAnalyzer/Checkers/MoveChecker.cpp Index: lib/StaticAnalyzer/Checkers/Mo

[PATCH] D55387: [analyzer] MoveChecker Pt.7: NFC: Misc refactoring.

2018-12-14 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MoveChecker.cpp:265 +void MoveChecker::checkUse(ProgramStateRef State, const MemRegion *Region, + const CXXRecordDecl *RD, MisuseKind MK, a_sidorin wrote: > I think tha

[PATCH] D55388: [analyzer] MoveChecker Pt.8: Add checks for dereferencing a smart pointer after move.

2018-12-14 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 178273. NoQ added a comment. Rebase. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55388/new/ https://reviews.llvm.org/D55388 Files: lib/StaticAnalyzer/Checkers/MoveChecker.cpp test/Analysis/use-after-move.cpp Index: test/Analysis/use-after-move.c

[PATCH] D55698: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function

2018-12-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo marked 2 inline comments as done. mstorsjo added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:5754-5756 + if (ClassExported && + Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) +MarkVTableUsed(Class->getLocation(), Class, true);

[PATCH] D55698: [MinGW] Produce a vtable and RTTI for dllexported classes without a key function

2018-12-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 178275. mstorsjo added a comment. Moved the code to work on DelayedDllExportClasses instead, as suggested, which still works for the testcase. (I've yet to test that approach on a larger codebase though.) CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 2 inline comments as done. erichkeane added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:1806-1836 +Extra.mangleSourceName("AS_"); +Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(TargetAS), + /*IsBoolean*/

[PATCH] D55719: [OpenMP] parsing and sema support for 'close' map-type-modifier

2018-12-14 Thread Ahsan Saghir via Phabricator via cfe-commits
saghir created this revision. saghir added reviewers: ABataev, kkwli0, Hahnfeld, RaviNarayanaswamy, mikerice, hfinkel, gtbercea. saghir added a project: clang. Herald added subscribers: cfe-commits, guansong. A map clause with the close map-type-modifier is a hint to prefer that the variables ar

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 178282. erichkeane added a comment. Should catch me up on all comments except @zturner's llvm-undname feature request :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55715/new/ https://reviews.llvm.org/D55715 Files: lib/AST/MicrosoftMangle.c

[PATCH] D55701: [analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore

2018-12-14 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. Thanks! Neat test. Can we now `assert(LocationE->isGLValue())` in `evalStore()`? What about `evalLoad()`? Also, were no other checkers affected? Like, will null pointer dereference checker now war

  1   2   >