]> granicus.if.org Git - clang/commit
Added method "HandleTopLevelDeclaration" to ASTConsumer. This will eventually
authorTed Kremenek <kremenek@apple.com>
Thu, 29 Nov 2007 23:05:17 +0000 (23:05 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 29 Nov 2007 23:05:17 +0000 (23:05 +0000)
commit2ff3e691ecc63a5d82d4023b46b5b47ce14ace53
treed9420070dd39ef047f0b1d04c651d1b20d91d440
parent48b1239860f0cc372f0e54588aa5e200abe6fcf2
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44444 91177308-0d34-0410-b5e6-96231b3b80d8
AST/ASTConsumer.cpp [new file with mode: 0644]
include/clang/AST/ASTConsumer.h