[PATCH] D24933: Enable configuration files in clang

2017-02-01 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 86761. sepavloff added a comment. Herald added a subscriber: danalbert. Updated patch Use more robust algorithm to determine custom compiler prefix. Bring the code in sync with changes in llvm patch. https://reviews.llvm.org/D24933 Files:

[PATCH] D24933: Enable configuration files in clang

2017-02-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 87229. sepavloff added a comment. Herald added a subscriber: klimek. Updated patch https://reviews.llvm.org/D24933 Files: docs/UsersManual.rst include/clang/Basic/DiagnosticDriverKinds.td include/clang/Config/config.h.cmake

[PATCH] D24933: Enable configuration files in clang

2017-02-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 2 inline comments as done. sepavloff added inline comments. Comment at: lib/Driver/ToolChain.cpp:183 std::string Target; - if (llvm::TargetRegistry::lookupTarget(Prefix, IgnoredError)) { + if (!VerifyTarget || llvm::TargetRegistry::lookupTarget(Prefix,

[PATCH] D30170: Function definition may have uninstantiated body

2017-02-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 89206. sepavloff added a comment. Implement `isDefined` through `isThisDeclarationADefinition`. https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp

[PATCH] D30170: Function definition may have uninstantiated body

2017-02-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Current implementation of `FunctionDecl::isDefined` does not take into account declarations that do not have a body, but it can be instantiated from a templated definition. This behavior creates problems when processing friend functions defined in class templates.

[PATCH] D30032: Process attributes 'ifunc' and 'alias' when checking for redefinition

2017-02-17 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL295541: Process attributes 'ifunc' and 'alias' when checking for redefinition (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D30032?vs=88700=89017#toc Repository: rL LLVM

[PATCH] D30375: Function with unparsed body is a definition

2017-02-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. While a function body is being parsed, the function declaration is not considered as a definition because it does not have a body yet. In some cases it leads to incorrect interpretation, the case is presented in https://bugs.llvm.org/show_bug.cgi?id=14785:

[PATCH] D30032: Process attributes 'ifunc' and 'alias' when checking for redefinition

2017-02-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. These attributes effectively turns a non-defining declaration into a definition, so the case when the declaration already has a body must be diagnosed properly. https://reviews.llvm.org/D30032 Files: lib/Sema/SemaDecl.cpp test/Sema/alias-redefinition.c

[PATCH] D30393: Do not inherit default arguments for friend function in class template.

2017-02-26 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. A function declared in a friend declaration may have declarations prior to the containing class definition. If such declaration defines default argument, the friend function declaration inherits them. This behavior causes problems if the class where the friend is

[PATCH] D24933: Enable configuration files in clang

2017-03-01 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Glad to know that someone is interested in this feature! Below is actual proposal. **Adding named configuration files to clang driver** A configuration file is a collection of driver options, which are inserted into command line before other options specified in the

[PATCH] D24933: Enable configuration files in clang

2016-12-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 81055. sepavloff marked 4 inline comments as done. sepavloff added a comment. Updated patch. - Directories which are searched for config files are now defined during project configuration process using special cmake options. - Driver do not warn on unused

[PATCH] D23096: [Sema] Pass CombineWithOuterScope = true to constructor of LocalInstantiationScope

2016-12-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. Looks good. Thank you! https://reviews.llvm.org/D23096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D24933: Enable configuration files in clang

2016-12-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 81057. sepavloff added a comment. Fixed grammar in comment, thanks to Hal Finkel. https://reviews.llvm.org/D24933 Files: docs/UsersManual.rst include/clang/Basic/DiagnosticDriverKinds.td include/clang/Config/config.h.cmake

[PATCH] D24933: Enable configuration files in clang

2016-12-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 81227. sepavloff added a comment. Addressed review notes. https://reviews.llvm.org/D24933 Files: docs/UsersManual.rst include/clang/Basic/DiagnosticDriverKinds.td include/clang/Config/config.h.cmake include/clang/Driver/Driver.h

[PATCH] D24933: Enable configuration files in clang

2016-12-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: include/clang/Driver/Driver.h:287 + const std::string () const { return ConfigFile; } + void setConfigFile(StringRef x, unsigned N) { +ConfigFile = x; bruno wrote: > x -> FileName Fixed.

[PATCH] D31126: Do not run tests for crash recovery if libstdc++ safe mode is enabled

2017-03-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Any feedback? https://reviews.llvm.org/D31126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31126: Do not run tests for crash recovery if libstdc++ safe mode is enabled

2017-03-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. If expensive checks are enabled, safe mode of libstdc++ is enabled too. In this mode the library uses more complex data that allow additional checks, for instance, a container may keep list of iterators that points to it. If a code crashes it can leave these

[PATCH] D30170: Function definition may have uninstantiated body

2017-03-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 92340. sepavloff added a comment. Small simplicifation https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp test/SemaCXX/friend2.cpp Index:

[PATCH] D31126: Do not run tests for crash recovery if libstdc++ safe mode is enabled

2017-04-15 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300392: Do not run tests for crash recovery if libstdc++ safe mode is enabled (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D31126?vs=92276=95372#toc Repository: rL LLVM

[PATCH] D31126: Do not run tests for crash recovery if libstdc++ safe mode is enabled

2017-04-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. The problem solved by the fix is still actual. https://reviews.llvm.org/D31126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26065: Improve diagnostics if friend function redefines file-level function.

2017-03-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Ping. https://reviews.llvm.org/D26065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36057: Use class to pass information about executable name

2017-07-30 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Herald added subscribers: srhines, klimek. Information about clang executable name component, such as target and driver mode, was passes in std::pair. With this change it is passed in special structure. It improves readability and makes access to this information

[PATCH] D24933: Enable configuration files in clang

2017-08-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 110909. sepavloff edited the summary of this revision. sepavloff added a comment. Updated patch - Some functionality, not related to config files directly, is move to separate changes - Cleanup of tests. This change does not implement using construct

[PATCH] D36057: Use class to pass information about executable name

2017-08-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 110906. sepavloff added a comment. Herald added a subscriber: mgorny. Updated patch - The class representing info about clang executable name now keeps driver mode component as well, - Added unit tests. https://reviews.llvm.org/D36057 Files:

[PATCH] D21767: Fix instantiation of friend function templates

2017-07-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 106914. sepavloff added a comment. Aligned implementation with https://reviews.llvm.org/D21508. https://reviews.llvm.org/D21767 Files: lib/AST/Decl.cpp lib/Sema/SemaTemplateInstantiate.cpp test/SemaTemplate/instantiate-friend-function.cpp Index:

[PATCH] D30170: Function definition may have uninstantiated body

2017-07-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Ping. https://reviews.llvm.org/D30170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D21508: Diagnose friend function template redefinitions

2017-07-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 106912. sepavloff edited the summary of this revision. sepavloff added a comment. Aligned implementation with https://reviews.llvm.org/D30170. https://reviews.llvm.org/D21508 Files: include/clang/AST/DeclBase.h lib/AST/Decl.cpp

[PATCH] D16579: Warn if friend function depends on template parameters.

2017-07-10 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 105853. sepavloff added a comment. Updated patch - Remove changes that are not needed anymore, - Function matching is implemented on recursive function instead of TypeVisitor. It support subset of checks, which should be enough for practical use. - Added

[PATCH] D30170: Function definition may have uninstantiated body

2017-07-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 106192. sepavloff added a comment. Rebased patch https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp

[PATCH] D21508: Diagnose friend function template redefinitions

2017-07-18 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 107091. sepavloff added a comment. Simplified patch https://reviews.llvm.org/D21508 Files: include/clang/AST/DeclBase.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index:

[PATCH] D21767: Fix instantiation of friend function templates

2017-07-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 107817. sepavloff added a comment. Reworked patch Used more general way to cope with calculation of instantiation stack, which is suitable for cases represented in PR26512. Added new tests. https://reviews.llvm.org/D21767 Files:

[PATCH] D36353: Instantiate constexpr function when it is used

2017-08-05 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Previous behavior was to instantiate constexpr function always, even if it is used in the body of a template. For instance, in the following code: template constexpr T foo(T x) { return x; } template T bar(T x) { return foo(0); } the function template

[PATCH] D36353: Instantiate constexpr function when it is used

2017-08-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 109928. sepavloff added a comment. Updated patch I missed CWG issue 1581. It make patch description invalid, but the patch itself can be repaired with small modification. This fix originated from the attempt to solve the problem described in

[PATCH] D33013: Driver must return non-zero code on errors in command line

2017-05-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 98930. sepavloff added a comment. Herald added a subscriber: klimek. Added missed case The patch missed a case when Compilation object is created during work of clang based tool, it resulted in fail of the test 'clang-tidy/diagnostic.cpp'. This addition to

[PATCH] D33173: Modify test to look for patterns in stderr as well

2017-05-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. With the change https://reviews.llvm.org/D33013 driver does not build compilation object if command line is invalid, in particular, if unrecognized option is provided. In such cases it prints diagnostics on stderr. The test 'clang-tidy/diagnostic.cpp' checks

[PATCH] D33013: Driver must return non-zero code on errors in command line

2017-05-11 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL302775: Driver must return non-zero code on errors in command line (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D33013?vs=98395=98592#toc Repository: rL LLVM

[PATCH] D24933: Enable configuration files in clang

2017-05-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 98330. sepavloff added a comment. Herald added subscribers: krytarowski, rengolin. Updated patch https://reviews.llvm.org/D24933 Files: docs/UsersManual.rst include/clang/Basic/DiagnosticDriverKinds.td include/clang/Config/config.h.cmake

[PATCH] D33013: Driver must return non-zero code on errors in command line

2017-05-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Herald added subscribers: krytarowski, javed.absar, nhaehnle, rengolin, aemerson. Now if clang driver is given wrong arguments, in some cases it continues execution and returns zero code. This change fixes this behavior. The fix revealed some errors in clang

[PATCH] D33272: Method loadFromCommandLine should be able to report errors

2017-05-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Now FixedCompilationDatabase::loadFromCommandLine has no means to report which error occurred if it fails to create compilation object. This is a block for implementing https://reviews.llvm.org/D33013, because after that change driver refuses to create

[PATCH] D33013: Driver must return non-zero code on errors in command line

2017-05-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: lib/Tooling/CompilationDatabase.cpp:208 IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions(); - UnusedInputDiagConsumer DiagClient; + TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), &*DiagOpts); + UnusedInputDiagConsumer

[PATCH] D33013: Driver must return non-zero code on errors in command line

2017-05-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99273. sepavloff added a comment. Moved tooling related code into separate change https://reviews.llvm.org/D33272 https://reviews.llvm.org/D33013 Files: include/clang/Tooling/CompilationDatabase.h lib/Driver/Driver.cpp

[PATCH] D33013: Driver must return non-zero code on errors in command line

2017-05-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 98395. sepavloff added a comment. Addressed reviewer's notes. https://reviews.llvm.org/D33013 Files: lib/Driver/Driver.cpp test/Driver/aarch64-cpus.c test/Driver/amdgpu-features.c test/Driver/arm-darwin-builtin.c

[PATCH] D33732: Catch invalid bitwise operation on vector of floats

2017-06-07 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304963: Catch invalid bitwise operation on vector of floats (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D33732?vs=101359=101856#toc Repository: rL LLVM

[PATCH] D26065: Improve diagnostics if friend function redefines file-level function.

2017-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304964: Improve diagnostics if friend function redefines file-level function. (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D26065?vs=101666=101859#toc Repository: rL

[PATCH] D30393: Do not inherit default arguments for friend function in class template.

2017-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304965: Do not inherit default arguments for friend function in class template. (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D30393?vs=101512=101861#toc Repository: rL

[PATCH] D30375: Function with unparsed body is a definition

2017-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101993. sepavloff added a comment. Changed implementation https://reviews.llvm.org/D30375 Files: include/clang/AST/Decl.h lib/Sema/SemaCUDA.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp

[PATCH] D30375: Function with unparsed body is a definition

2017-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thank you for explanation. Probably making new semantic action is an overkill. The intent was to postpone setting flag `WillHaveBody` as late as possible, to the moment when it becomes clear that the function indeed will have a body. Otherwise parsing of deleted

[PATCH] D30375: Function with unparsed body is a definition

2017-06-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Initial commit (r305379) was reverted (r305381) because it broke self builds. The reason was not related to the WillHaveBody flag but was due to the change: if (isFriend) { Function->setObjectOfFriendDecl(); if (FunctionTemplate)

[PATCH] D33173: Modify test to look for patterns in stderr as well

2017-05-24 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL303735: Modify test so that it looks for patterns in stderr as well (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D33173?vs=98928=100062#toc Repository: rL LLVM

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 100534. sepavloff added a comment. Updated patch - Reduce number of added functions, - Fixed some comments, - Function `isOdrDefined` now checks uninstantiated bodies only for friend functions. https://reviews.llvm.org/D30170 Files:

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 2 inline comments as done. sepavloff added a comment. In https://reviews.llvm.org/D30170#761342, @rsmith wrote: > Do we really need two different notions of "definition" and "odr definition" > here? What goes wrong if we always treat the "instantiation of a friend > function

[PATCH] D33272: Method loadFromCommandLine should be able to report errors

2017-05-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99600. sepavloff added a comment. Change loadFromCommandLine so that it returns std::unique_ptr as methods of CompilationDatabase does https://reviews.llvm.org/D33272 Files: include/clang/Tooling/CompilationDatabase.h

[PATCH] D33272: Method loadFromCommandLine should be able to report errors

2017-05-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D33272#758616, @joerg wrote: > Can this use ErrorOr? It makes sense if constructing methods of `CompilationDatabase` were also changed to return `ErrorOr`, as there is no need to have different interfaces for the similar functionality.

[PATCH] D33272: Method loadFromCommandLine should be able to report errors

2017-05-22 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99786. sepavloff marked an inline comment as done. sepavloff added a comment. Addressed reviewer's notes. https://reviews.llvm.org/D33272 Files: include/clang/Tooling/CompilationDatabase.h lib/Frontend/CreateInvocationFromCommandLine.cpp

[PATCH] D30170: Function definition may have uninstantiated body

2017-06-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101260. sepavloff added a comment. Do not call getCanonicalDecl for deleted functions https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp

[PATCH] D26065: Improve diagnostics if friend function redefines file-level function.

2017-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:646 + // in this case, redefinition will be diagnosed later. + (New->isInlineSpecified() || !New->isOutOfLine() || + !New->getLexicalDeclContext()->isRecord())) {

[PATCH] D33732: Catch invalid bitwise operation on vector of floats

2017-05-31 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Bitwise complement applied to vector of floats described with attribute `ext_vector_type` is not diagnosed as error. Attempt to compile such construct causes assertion violation in Instruction.cpp. With this change the complement is treated similar to the case of

[PATCH] D30393: Do not inherit default arguments for friend function in class template.

2017-06-05 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101512. sepavloff added a comment. Rebased patch https://reviews.llvm.org/D30393 Files: lib/Sema/SemaDeclCXX.cpp test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp Index: test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp

[PATCH] D30375: Function with unparsed body is a definition

2017-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101517. sepavloff added a comment. Rebased patch https://reviews.llvm.org/D30375 Files: include/clang/AST/Decl.h include/clang/Sema/Sema.h lib/Parse/Parser.cpp lib/Sema/SemaCUDA.cpp lib/Sema/SemaDecl.cpp

[PATCH] D33732: Catch invalid bitwise operation on vector of floats

2017-06-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: test/Sema/types.c:92 + +typedef float __attribute__((ext_vector_type(4))) float4; +float4 test3(float4 x) { bruno wrote: > Can you also add a test for the `vector_type` variant? It might be more > appropriate to put

[PATCH] D33732: Catch invalid bitwise operation on vector of floats

2017-06-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101359. sepavloff added a comment. Updated regression test The new regression test was obtained from Sema/vector-ops.c, the part of it that checks binary complement was copied. https://reviews.llvm.org/D33732 Files: lib/Sema/SemaExpr.cpp

[PATCH] D30170: Function definition may have uninstantiated body

2017-06-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101362. sepavloff added a comment. Updated patch according to review notes https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index:

[PATCH] D26065: Improve diagnostics if friend function redefines file-level function.

2017-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101666. sepavloff added a comment. Rebased and enhance check https://reviews.llvm.org/D26065 Files: lib/Sema/SemaDeclCXX.cpp test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp Index: test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp

[PATCH] D30375: Function with unparsed body is a definition

2017-06-14 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305379: Function with unparsed body is a definition (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D30375?vs=101993=102512#toc Repository: rL LLVM

[PATCH] D30375: Function with unparsed body is a definition

2017-06-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thank you! Committed as is, improvements will be made as separate patches. Repository: rL LLVM https://reviews.llvm.org/D30375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99698. sepavloff added a comment. Made the patch a bit more compact. NFC. https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp

[PATCH] D21508: Diagnose friend function template redefinitions

2017-09-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 115539. sepavloff added a comment. Rebased https://reviews.llvm.org/D21508 Files: include/clang/AST/DeclBase.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index:

[PATCH] D30170: Function definition may have uninstantiated body

2017-09-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 115534. sepavloff added a comment. Rebased patch. https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp

[PATCH] D24933: Enable configuration files in clang

2017-10-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Here is a list of design solutions used in this implementation of config files. **How config file is specified** There are two ways to specify config file: - To encode it into executable file name, such as `foo-clang`, - To pass config file in command line arguments.

[PATCH] D21767: Fix instantiation of friend function templates

2017-09-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 116484. sepavloff edited the summary of this revision. sepavloff added a comment. Added regression test for PR34343 Investigation of this defect is presented in https://bugs.llvm.org/show_bug.cgi?id=34343 . https://reviews.llvm.org/D21767 Files:

[PATCH] D36057: Use class to pass information about executable name

2017-08-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. @echristo Committed, thanks. Repository: rL LLVM https://reviews.llvm.org/D36057 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36057: Use class to pass information about executable name

2017-08-28 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311981: Use class to pass information about executable name (authored by sepavloff). Repository: rL LLVM https://reviews.llvm.org/D36057 Files: cfe/trunk/include/clang/Driver/Driver.h

[PATCH] D24933: Enable configuration files in clang

2017-10-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 118315. sepavloff added a comment. Updated patch according to reviewer's notes https://reviews.llvm.org/D24933 Files: docs/UsersManual.rst include/clang/Basic/DiagnosticDriverKinds.td include/clang/Config/config.h.cmake

[PATCH] D24933: Enable configuration files in clang

2017-10-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 28 inline comments as done. sepavloff added a comment. @hfinkel Thank you for explanations! https://reviews.llvm.org/D24933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Herald added a subscriber: JDevlieghere. If a source file extensively uses templates, resulting LLVM IR may have types with huge names. It may occur if a record type is defined in a class. In this case its type name contains all declaration contexts and, if a

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D40508#937212, @rjmccall wrote: > In Swift's IRGen, we have an option controlling whether to emit meaningful > value names. That option can be set directly from the command line, but it > defaults to whether we're emitting IR assembly

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 124587. sepavloff added a comment. Updated patch as part of it was committed in https://reviews.llvm.org/rL319178 https://reviews.llvm.org/D40508 Files: include/clang/AST/PrettyPrinter.h lib/AST/TypePrinter.cpp lib/CodeGen/CodeGenTypes.cpp

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 3 inline comments as done. sepavloff added a comment. In https://reviews.llvm.org/D40508#936617, @rnk wrote: > It's not clear to me that this abbreviation functionality should live in > Support. Clang probably wants enough control over this (assuming we're doing > it) that the

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. https://reviews.llvm.org/D40567 presents a patch that adds template argument names to class template specializations. It also describes the use case in which type names are used to identify type across different TUs. Adding template parameters obviously increase

[PATCH] D40567: Always show template parameters in IR type names

2017-11-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Herald added subscribers: JDevlieghere, eraman. If a module contains opaque type and another one contains definition of equivalent type in sense of C++, `llvm-link` merges these types. In this procedure it can rely only on type name. An issue arises if the type is

[PATCH] D40013: [DeclPrinter] Allow printing fully qualified name of function declaration

2017-11-22 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318896: [DeclPrinter] Allow printing fully qualified name of function declaration (authored by sepavloff). Repository: rL LLVM https://reviews.llvm.org/D40013 Files:

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D40508#938040, @rjmccall wrote: > My skepticism about the raw_ostream is not about the design of having a > custom raw_ostream subclass, it's that that subclass could conceivably be > re-used by some other client. It feels like it belongs

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D40508#938686, @rjmccall wrote: > In https://reviews.llvm.org/D40508#938675, @sepavloff wrote: > > > In https://reviews.llvm.org/D40508#938040, @rjmccall wrote: > > > > > My skepticism about the raw_ostream is not about the design of having

[PATCH] D40567: Always show template parameters in IR type names

2017-11-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D40567#940025, @rsmith wrote: > What actual problem is this solving? These IR type names exist only for the > convenience of humans reading the IR, and making them long (potentially > extremely long) by including template arguments seems

[PATCH] D40508: Replace long type names in IR with hashes

2017-11-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D40508#939513, @rjmccall wrote: > In https://reviews.llvm.org/D40508#938854, @sepavloff wrote: > > > In https://reviews.llvm.org/D40508#938686, @rjmccall wrote: > > > > > The LLVM linking model does not actually depend on struct type names

[PATCH] D40567: Always show template parameters in IR type names

2017-12-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Consider a bit more complicated example. File `common.h` #ifndef COMMON_H #define COMMON_H struct Alarm { }; struct Info { }; template struct Handler; #endif File `use-1.cpp` #include "common.h" Handler *info; void set(Handler *e) { info = e; }

[PATCH] D41237: [Frontend] Handle skipped bodies in template instantiations

2017-12-18 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: lib/Sema/SemaDecl.cpp:12184 Decl *Sema::ActOnSkippedFunctionBody(Decl *Decl) { - if (FunctionDecl *FD = dyn_cast_or_null(Decl)) + if (FunctionDecl *FD = Decl->getAsFunction()) FD->setHasSkippedBody(); In the

[PATCH] D24933: Enable configuration files in clang

2017-12-15 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 2 inline comments as done. sepavloff added inline comments. Comment at: include/clang/Config/config.h.cmake:40 +#cmakedefine CLANG_CONFIG_FILE_SYSTEM_DIR ${CLANG_CONFIG_FILE_SYSTEM_DIR} +#cmakedefine CLANG_CONFIG_FILE_USER_DIR ${CLANG_CONFIG_FILE_USER_DIR} +

[PATCH] D24933: Enable configuration files in clang

2017-12-15 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 127109. sepavloff added a comment. Updated patch Fixed cmake config file definition. Use llvm::sys::fs::make_absolute to get absolute path. https://reviews.llvm.org/D24933 Files: docs/UsersManual.rst include/clang/Basic/DiagnosticDriverKinds.td

[PATCH] D41189: [Frontend] Treat function with skipped body as definition

2017-12-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. Thanks! Repository: rC Clang https://reviews.llvm.org/D41189 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41237: [Frontend] Handle skipped bodies in template instantiations

2017-12-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. Thanks! Repository: rC Clang https://reviews.llvm.org/D41237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41433: Unit tests for TBAA metadata generation.

2017-12-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rjmccall, hfinkel. Herald added subscribers: kosarev, mgorny. Now tests for metadata created by clang involve compiling code snippets placed into c/c++ source files and matching interesting patterns in the obtained textual representation

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Is it correct to emit error in this case? According to the Standard 10.5p1 "All function types, function names with external linkage, and variable names with external linkage have a language linkage". So templates do not have a language linkage. The next paragraph,

[PATCH] D24933: Enable configuration files in clang

2017-11-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 123503. sepavloff added a comment. Updated patch - Added command line option for setting directories where config files are searched for, - Fixed architecture calculation, - Option --config in config file is now diagnosed, - Output made by option -v

[PATCH] D40013: [DeclPrinter] Allow printing fully qualified name of function declaration

2017-11-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. Thanks! https://reviews.llvm.org/D40013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40567: Always show template parameters in IR type names

2017-12-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 125761. sepavloff added a comment. Updated patch - old type names are generated always if --ir-type-names is not specified, - added new value of --ir-type-names, none, to suppress type names, - value of --ir-type-names is stored in module properties.

[PATCH] D46241: [CodeGen] Recognize more cases of zero initialization

2018-05-07 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 145445. sepavloff marked an inline comment as done. sepavloff added a comment. Avoid redundant initializer calculation Repository: rC Clang https://reviews.llvm.org/D46241 Files: include/clang/AST/Expr.h lib/AST/ExprConstant.cpp

[PATCH] D46241: [CodeGen] Recognize more cases of zero initialization

2018-05-07 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: lib/CodeGen/CGExprConstant.cpp:1413 + } else if (!Init->isEvaluatable(CE.CGM.getContext())) { +return false; + } else if (InitTy->hasPointerRepresentation()) { rsmith wrote: > sepavloff wrote: > > rjmccall

[PATCH] D46241: [CodeGen] Recognize more cases of zero initialization

2018-05-10 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 146091. sepavloff added a comment. Updated patch Try evaluating initializer value only if the initializer type is integral or pointer. It avoids calculation of large value, which then is discarded. Repository: rC Clang https://reviews.llvm.org/D46241

[PATCH] D46241: [CodeGen] Recognize more cases of zero initialization

2018-05-10 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: lib/CodeGen/CGExprConstant.cpp:1414-1415 +Expr::EvalResult Result; +if (Init->EvaluateAsRValue(Result, CE.CGM.getContext()) && +!Result.hasUnacceptableSideEffect(Expr::SE_NoSideEffects)) + return

  1   2   >