[PATCH] D55948: Modify DeclaratorChuck::getFunction to use DeclSpec for qualifiers
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 24 06:30:27 PST 2018
Anastasia marked 3 inline comments as done.
Anastasia added inline comments.
================
Comment at: lib/Parse/ParseDecl.cpp:6129
+ // create DeclSpec here to be populated later.
+ DS = new DeclSpec(AttrFactory);
+
----------------
rjmccall wrote:
> Is it possible to just build into a local DS and then move that DS to the heap if it contains qualifiers or attributes? It'd be nice to not do a heap allocation every time we parse a function declarator in C++ since the vast majority of them don't have qualifiers. (It probably has to be a move to handle attributes and `AttributeFactory` correctly.)
>
> That would also side-step any concerns about memory management.
I found `DeclSpec` a bit copy-unfriednly... not sure it was better to modify its interface. For now I just provide custom impl for function quals.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55948/new/
https://reviews.llvm.org/D55948
More information about the cfe-commits
mailing list