[cfe-commits] r44444 - in /cfe/trunk: AST/ASTConsumer.cpp include/clang/AST/ASTConsumer.h
Chris Lattner
clattner at apple.com
Thu Nov 29 15:19:43 PST 2007
On Nov 29, 2007, at 3:05 PM, Ted Kremenek wrote:
> Author: kremenek
> Date: Thu Nov 29 17:05:17 2007
> New Revision: 44444
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44444&view=rev
> Log:
> Added method "HandleTopLevelDeclaration" to ASTConsumer. This will
> eventually
> be the new hook that ASTStreamer calls to feed top-level Decls to
> ASTConsumers.
>
> The difference between "HandleTopLevelDeclaration" and
> "HandleTopLevelDecl" is
> that "HandleTopLevelDecl" is currently called by ASTStreamer for every
> top-level declaration, including those that appear within a Decl
> chain. Using
> the new interface, ASTStreamer would only call
> HandleTopLevelDeclaration for
> Decls that appear that the beginning of a Decl chain (i.e., a group
> of related
> decls).
>
> To preserve the behavior that all subclasses of ASTConsumer
> currently expect,
> the default implementation of HandleTopLevelDeclaration simply calls
> HandleTopLevelDecl, and for decl chains it calls HandleTopLevelDecl
> for each
> Decl* in a chain of Decls.
>
> The advantage of this interface is that some subclasses of
> ASTConsumer only
> really want the Decl chain, and not each individual Decl passed to
> them. This
> extra level of indirection allows subclasses to override the
> default behavior
> if they so desire.
Ok. Can you guys please come up with better names than
HandleTopLevelDeclaration vs HandleTopLevelDecl though? :)
-Chris
More information about the cfe-commits
mailing list