[cfe-commits] PATCH: Call EndSourceFile() from ParseAST

Chris Lattner clattner at apple.com
Thu Dec 9 14:24:01 PST 2010


Makes sense to me, please apply.  Thanks Craig.

-Chris

On Dec 3, 2010, at 7:49 PM, Craig Silverstein wrote:

> I registered a PPCallback and was confused when EndOfMainFile() was
> not being called on it.  Tracing through the code, it looks like it's
> just because the appropriate callback wasn't being called form the
> parsing routine.
> 
> I don't know the big picture enough to say if EndSourceFile() is
> supposed to be being called from somewhere else, but this fixed the
> problem for me.  Does it look correct?  Look good to apply?
> 
> craig
> Index: ParseAST.cpp
> ===================================================================
> --- ParseAST.cpp	(revision 120802)
> +++ ParseAST.cpp	(working copy)
> @@ -97,6 +97,8 @@
>        E = S.WeakTopLevelDecls().end(); I != E; ++I)
>     Consumer->HandleTopLevelDecl(DeclGroupRef(*I));
> 
> +  S.getPreprocessor().EndSourceFile();
> +
>   // Dump record layouts, if requested.
>   if (S.getLangOptions().DumpRecordLayouts)
>     DumpRecordLayouts(S.getASTContext());
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list