================
Comment at: clang-tidy/readability/RemoveVoidArg.cpp:174
@@ +173,3 @@
+void RemoveVoidArg::processFieldDecl(const MatchFinder::MatchResult &Result, 
FieldDecl const *const Member) {
+    std::string const Text = getText(Result, *Member);
+    removeVoidArgumentTokens(Result, Member->getLocStart(), Text, "Redundant 
void argument list in field declaration.");
----------------
sbenza wrote:
> LegalizeAdulthood wrote:
> > sbenza wrote:
> > > Any reason all of these convert the StringRef into a std::string?
> > > Couldn't they work with the StringRef directly?
> > I tried switching it to a StringRef, but when I tried to combine it with 
> > other text to build a replacement for diag(), it got turned into Twine and 
> > then failed to match any signature for diag().  I'm open to suggestions for 
> > what you'd like to see instead.
> Twine::str() constructs the string.
> I don't mind constructing a string when a match happens. Those are rare.
> But we should avoid allocating memory when no match happens.
> Right now temporary memory allocations are a considerable part of 
> clang-tidy's runtime. We should try to minimize that.
I think we are at that stage now; I do all early-out testing before 
constructing the replacement string.

http://reviews.llvm.org/D7639

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to