[all-commits] [llvm/llvm-project] e22ebe: [Bounds-Safety] Add sized_by, counted_by_or_null &...

Henrik G. Olsson via All-commits all-commits at lists.llvm.org
Tue Jul 9 13:58:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e22ebee5a3bb56cb7f9a9513f01fb7ed24b23f48
      https://github.com/llvm/llvm-project/commit/e22ebee5a3bb56cb7f9a9513f01fb7ed24b23f48
  Author: Henrik G. Olsson <hnrklssn at gmail.com>
  Date:   2024-07-09 (Tue, 09 Jul 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/TypePrinter.cpp
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/lib/Sema/TreeTransform.h
    A clang/test/AST/attr-counted-by-or-null-late-parsed-struct-ptrs.c
    A clang/test/AST/attr-counted-by-or-null-struct-ptrs.c
    A clang/test/AST/attr-sized-by-late-parsed-struct-ptrs.c
    A clang/test/AST/attr-sized-by-or-null-late-parsed-struct-ptrs.c
    A clang/test/AST/attr-sized-by-or-null-struct-ptrs.c
    A clang/test/AST/attr-sized-by-struct-ptrs.c
    A clang/test/Sema/attr-counted-by-or-null-last-field.c
    A clang/test/Sema/attr-counted-by-or-null-late-parsed-off.c
    A clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c
    A clang/test/Sema/attr-counted-by-or-null-struct-ptrs-sizeless-types.c
    A clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c
    A clang/test/Sema/attr-counted-by-or-null-vla-sizeless-types.c
    M clang/test/Sema/attr-counted-by-vla.c
    A clang/test/Sema/attr-sized-by-last-field.c
    A clang/test/Sema/attr-sized-by-late-parsed-off.c
    A clang/test/Sema/attr-sized-by-late-parsed-struct-ptrs.c
    A clang/test/Sema/attr-sized-by-or-null-last-field.c
    A clang/test/Sema/attr-sized-by-or-null-late-parsed-off.c
    A clang/test/Sema/attr-sized-by-or-null-late-parsed-struct-ptrs.c
    A clang/test/Sema/attr-sized-by-or-null-struct-ptrs-sizeless-types.c
    A clang/test/Sema/attr-sized-by-or-null-struct-ptrs.c
    A clang/test/Sema/attr-sized-by-or-null-vla-sizeless-types.c
    A clang/test/Sema/attr-sized-by-struct-ptrs-sizeless-types.c
    A clang/test/Sema/attr-sized-by-struct-ptrs.c
    A clang/test/Sema/attr-sized-by-vla-sizeless-types.c

  Log Message:
  -----------
  [Bounds-Safety] Add sized_by, counted_by_or_null & sized_by_or_null (#93231)

The attributes `sized_by`, `counted_by_or_null` and `sized_by_or_null`
have been added as variants on `counted_by`, each with slightly
different semantics. `sized_by` takes a byte size parameter instead of
an element count, allowing pointees with unknown size. The
`counted_by_or_null` and `sized_by_or_null` variants are equivalent to
their base variants, except the pointer can be null regardless of
count/size value. If the pointer is null the size is effectively 0.

rdar://125400354



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list