[all-commits] [llvm/llvm-project] 61d766: [Clang][counted_by] Use the expr's RecordDecl that...

Bill Wendling via All-commits all-commits at lists.llvm.org
Mon Jul 6 13:56:30 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 61d766817b9ebe9804c84d71aa7a620962436dff
      https://github.com/llvm/llvm-project/commit/61d766817b9ebe9804c84d71aa7a620962436dff
  Author: Bill Wendling <morbo at google.com>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    M clang/lib/CodeGen/CGExpr.cpp
    A clang/test/CodeGen/attr-counted-by-nested-structs.c

  Log Message:
  -----------
  [Clang][counted_by] Use the expr's RecordDecl that transitively contains the counter field (#205903)

The counted field could be in nested structs. This can happen when the
Expr is pointing to a field that has a struct type. The original code
didn't do a good job at finding the best RecordDecl to build the GEP off
of. It made too many assumptions about how structs' layouts.

This rewrite finds the RecordDecl that transitively contains the
__counted_by__'s counter field.

Fixes: #205652



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