[PATCH] D126066: [clang] Don't plumb access specifier attributes through Parser unnecessarily.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 20 06:42:43 PDT 2022


mboehme created this revision.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

I noticed that a lot of functions in the parser take an `AccessAttrs` parameter,
even though, as far as I can tell, it's sufficient to handle access specifier
attributes locally where the access specifier is parsed.

I have removed all of this plumbing, and tests still pass. Much of the code
involved is pretty old, so I suspect this plumbing was required at some point
but that the underlying reason has now been eliminated. It may also be that at
some point people started simply following the pattern of "pass `AccessAttrs`
wherever an `AccessSpecifier` is passed".

However, I would appreciate a close look from someone who's more familiar with
the code than I am.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126066

Files:
  clang/include/clang/Parse/Parser.h
  clang/lib/Parse/ParseCXXInlineMethods.cpp
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseOpenMP.cpp
  clang/lib/Parse/ParseTemplate.cpp
  clang/lib/Parse/Parser.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126066.430959.patch
Type: text/x-patch
Size: 19319 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220520/a22e8b94/attachment-0001.bin>


More information about the cfe-commits mailing list