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

Ben Gertzfield bgertzfield at gmail.com
Tue Feb 5 08:55:40 PST 2013

  Fixed, thanks.

Comment at: lib/Frontend/ASTUnit.cpp:579-580
@@ -576,1 +578,4 @@
+    // constructed, so register them now.
+    Context.getCommentCommandTraits().RegisterCommentOptions(
+      LangOpt.CommentOpts);
Dmitri Gribenko wrote:
> As far as I see, updated() can be called multiple times.  We will get multiple commands with the same name registered.
> I'm not sure that this is the correct place to put this, though.  Not all PCH loading is done through ASTUnit.  CompilerInstance::createPCHExternalASTSource might be the correct one, but I'm not sure.  I'll ask Doug.
I re-read the code and confirmed that updated() is called exactly once: only after both the target and language opts have been deserialized (whichever order that happens in).

I'm pretty confident this is a good place to read the deserialized LanguageOptions; there is no other location in the code that receives them, as far as I can tell. 


More information about the cfe-commits mailing list