[PATCH] Add readability-redundant-void-arg check to clang-tidy
Richard
legalize at xmission.com
Sun Mar 8 07:29:22 PDT 2015
In http://reviews.llvm.org/D7639#136280, @xazax.hun wrote:
> In http://reviews.llvm.org/D7639#136129, @LegalizeAdulthood wrote:
>
> > If you can show me how to lex a SourceRange without getting that error, I'm happy to change it. I tried the method shown in the linked diff and I get the same error.
>
>
> As far as I know, the point is that you can not do that without creating a null terminated string, however you do not need to do that. What you can do insead: you can lex the whole file buffer starting from the beginning of a declaration and you can make sure that you finish lexing on the end of the declaration (e.g.: end lexing when you match the closing paren of the declaration). This way you might have a bit more complicated lexing logic but you avoid heap allocation. So the point is: you construct the lexer using the whole file buffer starting from the right position and not relying on the source range at all to finish lexing.
Relex the entire file just to avoid a heap allocation? That seems a bit excessive. Do we have any measurements on real code bases that show this to be the better approach? I don't want to optimize like this without real data to show that it is worthwhile.
http://reviews.llvm.org/D7639
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list