[cfe-commits] [PATCH] Add CommentOptions, allow specifying custom comment block commands

Dmitri Gribenko gribozavr at gmail.com
Wed Jan 9 13:24:44 PST 2013



================
Comment at: include/clang/Basic/CommentOptions.h:25
@@ +24,3 @@
+struct CommentOptions {
+  typedef llvm::SmallVector<llvm::StringRef, 4> BlockCommandNamesTy;
+
----------------
Ben Gertzfield wrote:
> Dmitri Gribenko wrote:
> > '4' can be safely changed to '1', since most of the time there will be no commands here.
> > 
> > Or even use a std::vector since otherwise it is not clear who owns memory for StringRefs (when CommentOptions is created, ASTContext is not yet created, so we can not allocate memory there).
> I see, thanks for clarifying. Should I just use std::vector<std::string> then?
> 
Oh, I'm sorry -- I meant to say "use a std::string..."

Yes, there are two possibilities: std::vector<std::string> and SmallVector<std::string>.

I don't see how one is better than the other, so I don't have a preference.


http://llvm-reviews.chandlerc.com/D272



More information about the cfe-commits mailing list