• Lukasz Anforowicz's avatar
    Avoiding rewriting pointers to non-free-standing structs. · e1d6ceeb
    Lukasz Anforowicz authored
    A tag (struct, class, union or enum) is free-standing if its declaration
    is not immediately used as part of a type of a field or variable.  See
    also clang::TagDecl::isFreeStanding method.  Example of a
    non-free-standing struct:
      struct NonFreeStandingStructCanHaveAName {
        int some_field;
      }* ptr_to_the_non_free_standing_struct;
    
    After this CL, the rewriter will avoid rewriting pointers to
    non-free-standing structs, because 1) such structs are relatively rare
    and 2) such structs are difficult to rewrite correctly (essentially the
    definition of the struct has to be used as a template argument of
    CheckedPtr).
    
    Bug: 1069567
    Change-Id: Ib571344594795334be90bef5350a467d5841d96d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2173575
    Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#768963}
    e1d6ceeb
RewriteRawPtrFields.cpp 9.27 KB