[cfe-dev] Stopping the execution of an ASTConsumer

Douglas Gregor dgregor at apple.com
Mon Nov 14 10:13:16 PST 2011


On Nov 14, 2011, at 4:00 AM, Jorge Fernández Fabeiro wrote:

> Hello,
> 
> I'm using Clang to parse a file with C source code in order to search for some annotations previously I have defined. When the visitor finds an annotation, it's supposed to invoke a function that makes some source-to-source transformations in the file passed. But, in some cases, the annotation format can be incorrect, so the code visiting should be stopped, not visiting any node anymore. Is that possible?

ASTConsumers don't currently have this ability, although it would be fairly easy to introduce.

	- Doug



More information about the cfe-dev mailing list