[all-commits] [llvm/llvm-project] 32946d: [clang-include-cleaner] Make cleanup attr report e...

Daan De Meyer via All-commits all-commits at lists.llvm.org
Wed May 21 07:40:53 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 32946ddd2e5ab83505e832b7ef43bc10bd6dce68
      https://github.com/llvm/llvm-project/commit/32946ddd2e5ab83505e832b7ef43bc10bd6dce68
  Author: Daan De Meyer <daan.j.demeyer at gmail.com>
  Date:   2025-05-21 (Wed, 21 May 2025)

  Changed paths:
    M clang-tools-extra/include-cleaner/lib/WalkAST.cpp
    M clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
    M clang/include/clang/Basic/Attr.td
    M clang/lib/Sema/SemaDeclAttr.cpp

  Log Message:
  -----------
  [clang-include-cleaner] Make cleanup attr report expr location (#140233)

Instead of reporting the location of the attribute, let's report the
location of the function reference that's passed to the cleanup
attribute as the first argument. This is required as the attribute might
be coming from a macro which means clang-include-cleaner skips the use
as it gets attributed to the header file declaringt the macro and not to
the main file.

To make this work, we have to add a fake argument to the CleanupAttr
constructor so we can pass in the original Expr alongside the function
declaration.

Fixes #140212



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