This is an archive of the discontinued LLVM Phabricator instance.

[LLVM] Fix Clang-tidy llvm-namespace-comment warnings
AbandonedPublic

Authored by Eugene.Zelenko on Jul 27 2015, 6:26 PM.

Details

Reviewers
None
Summary

I checked this patch on my own build on RHEL 6. Regressions were OK.

Please check it in if it's OK, because I don't have SVN write access.

Diff Detail

Event Timeline

Eugene.Zelenko retitled this revision from to [LLVM] Fix Clang-tidy llvm-namespace-comment warnings.
Eugene.Zelenko updated this object.

I'm not sure this kind of clean-up is worth the effort. Some of these are kind of nice as consistency improvements, but many seem redundant; for example a short namespace such as 'object' in include/llvm/ExecutionEngine/RuntimeDyld.h which only contains two declarations probably doesn't need a comment.

Same goes for http://reviews.llvm.org/D11549.

I think it's better to place comments consistently independently from number of declarations in namespace.

At least Clang-tidy llvm-namespace-comment will be happy and will not complain on same part of code in future.

alexfh added a subscriber: alexfh.Jul 31 2015, 3:18 AM

Apparently, the check is not completely aligned with the preferences of the
community. The relevant rule in the LLVM Coding Standards
http://llvm.org/docs/CodingStandards.html#namespace-indentation doesn't
mandate the use of the namespace ending comments and it uses a slightly
different wording for them ("end namespace xxx" or "end anonymous
namespace"). There's also no recommended minimum namespace size, after
which the comments should be used. Thus the check first needs to be updated
according with the coding standards and community preferences (and maybe
the relevant rule of the coding standards should be made a bit more
specific, so that it's possible to implement in the check).

I already submitted a cleanup patch for this check once (r240270), but had
to revert it later due to the reasons above.

Eugene.Zelenko abandoned this revision.Oct 8 2015, 1:02 PM