[cfe-commits] r151330 - in /cfe/trunk: lib/Serialization/ASTWriter.cpp test/Index/targeted-cursor.m test/Index/targeted-cursor.m.h

David Blaikie dblaikie at gmail.com
Thu Feb 23 20:26:01 PST 2012


On Thu, Feb 23, 2012 at 5:12 PM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
> Author: akirtzidis
> Date: Thu Feb 23 19:12:38 2012
> New Revision: 151330
>
> URL: http://llvm.org/viewvc/llvm-project?rev=151330&view=rev
> Log:
> [PCH] When keeping track of top-level decls for "targeted deserialization"
> make sure we don't mistake ParmVarDecls for top-level decls.

I've committed r151343 to fix this on platforms where blocks are not
on by default. Please refix/let me know if it's not the right approach
(going on other tests in the same directory it looks fine though).

- David

>
> Fixes rdar://10920009.
>
> Added:
>    cfe/trunk/test/Index/targeted-cursor.m
>    cfe/trunk/test/Index/targeted-cursor.m.h
> Modified:
>    cfe/trunk/lib/Serialization/ASTWriter.cpp
>
> Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=151330&r1=151329&r2=151330&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTWriter.cpp Thu Feb 23 19:12:38 2012
> @@ -3860,6 +3860,9 @@
>   // We only keep track of the file-level declarations of each file.
>   if (!D->getLexicalDeclContext()->isFileContext())
>     return;
> +  // FIXME: We should never have ParmVarDecls with TU as context.
> +  if (isa<ParmVarDecl>(D))
> +    return;
>
>   SourceManager &SM = Context->getSourceManager();
>   SourceLocation FileLoc = SM.getFileLoc(Loc);
>
> Added: cfe/trunk/test/Index/targeted-cursor.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/targeted-cursor.m?rev=151330&view=auto
> ==============================================================================
> --- cfe/trunk/test/Index/targeted-cursor.m (added)
> +++ cfe/trunk/test/Index/targeted-cursor.m Thu Feb 23 19:12:38 2012
> @@ -0,0 +1,6 @@
> +
> +// rdar://10920009
> +// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %S/targeted-cursor.m.h -Xclang -detailed-preprocessing-record
> +// RUN: c-index-test -cursor-at=%S/targeted-cursor.m.h:5:13 %s -include %t.h | FileCheck %s
> +
> +// CHECK: ObjCClassRef=I:2:12
>
> Added: cfe/trunk/test/Index/targeted-cursor.m.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/targeted-cursor.m.h?rev=151330&view=auto
> ==============================================================================
> --- cfe/trunk/test/Index/targeted-cursor.m.h (added)
> +++ cfe/trunk/test/Index/targeted-cursor.m.h Thu Feb 23 19:12:38 2012
> @@ -0,0 +1,7 @@
> +
> + at interface I
> +
> +-(void)mm:(void (^)(I*))block;
> +-(void)mm2:(I*)i;
> +
> + at end
>
>
> _______________________________________________
> 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