[cfe-commits] [PATCH] Structured comment parsing, retaining comments in AST
Matthieu Monrocq
matthieu.monrocq at gmail.com
Wed Jun 13 11:40:58 PDT 2012
Hi Dmitri,
Since you say that most time is spent during `vector::push_back` I was
wondering if using a `deque` instead would help alleviate this cost.
It is not necessarily a "free" change as the storage is no longer
contiguous, on the other hand, it means avoiding all reallocations.
-- Matthieu
On Wed, Jun 13, 2012 at 3:34 AM, Dmitri Gribenko <gribozavr at gmail.com>wrote:
> On Mon, Jun 11, 2012 at 8:39 AM, Douglas Gregor <dgregor at apple.com> wrote:
> > Please use FileCheck rather than grep.
>
> Done.
>
>
> > Might SmallString<256> be a better choice here than std::string, since
> many comments are likely to be short?
>
> Does not apply to latest version of the patch where a single
> SourceRange is tracked for a merged comment in order to be able
> associate source locations with tokens inside comments.
>
> > Should we insert an empty string into DeclComments early on, before we
> do the work of performing lower_bound, so that repeated queries for the
> comment string of a declaration that does *not* have a comment don't keep
> performing lower_bound calls? In other words, should we cache the negative
> case as well as the positive case?
>
> Implemented caching negative results, but in a different way.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120613/54f40f17/attachment.html>
More information about the cfe-commits
mailing list