[cfe-commits] r43391 - in /cfe/trunk: Driver/RewriteTest.cpp Sema/ASTStreamer.cpp include/clang/AST/ASTConsumer.h

Chris Lattner clattner at apple.com
Tue Oct 30 11:40:58 PDT 2007


On Oct 26, 2007, at 12:46 PM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Fri Oct 26 14:46:17 2007
> New Revision: 43391
>
> URL: http://llvm.org/viewvc/llvm-project?rev=43391&view=rev
> Log:
> Patch to synthesize computation of Ivar offset in rewritten c file.
> Thanks to Steve N. to point out using of offsetof for this.

Hi Fariborz,

> ====================================================================== 
> ========
> --- cfe/trunk/Sema/ASTStreamer.cpp (original)
> +++ cfe/trunk/Sema/ASTStreamer.cpp Fri Oct 26 14:46:17 2007
> @@ -107,6 +107,8 @@
>
>    while (Decl *D = Streamer.ReadTopLevelDecl())
>      Consumer.HandleTopLevelDecl(D);
> +
> +  Consumer.HandleObjcMetaDataEmission();
>
> --- cfe/trunk/include/clang/AST/ASTConsumer.h (original)
> +++ cfe/trunk/include/clang/AST/ASTConsumer.h Fri Oct 26 14:46:17 2007
> @@ -34,6 +34,11 @@
>    virtual void HandleTopLevelDecl(Decl *D) {
>    }
>
> +  /// HandleObjcMetaDataEmission - top level routine for objective-c
> +  /// metadata emission.
> +  virtual void HandleObjcMetaDataEmission() {
> +  }

Please don't add a hook for this to ASTConsumer.  There is no need  
for this, the rewriter can do this activity when the destructor runs.

-Chris



More information about the cfe-commits mailing list