[all-commits] [llvm/llvm-project] c058a7: Correct the tablegen for checking mutually exclusi...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Apr 13 12:20:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c058a7122787c8e503cf6306b8da03c0e56a41a5
      https://github.com/llvm/llvm-project/commit/c058a7122787c8e503cf6306b8da03c0e56a41a5
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2021-04-13 (Tue, 13 Apr 2021)

  Changed paths:
    M clang/include/clang/Sema/ParsedAttr.h
    M clang/lib/Sema/ParsedAttr.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaStmtAttr.cpp
    M clang/test/SemaCXX/attr-likelihood.cpp
    M clang/utils/TableGen/ClangAttrEmitter.cpp

  Log Message:
  -----------
  Correct the tablegen for checking mutually exclusive stmt attrs

The previous implementation was insufficient for checking statement
attribute mutual exclusion because attributed statements do not collect
their attributes one-at-a-time in the same way that declarations do. So
the design that was attempting to check for mutual exclusion as each
attribute was processed would not ever catch a mutual exclusion in a
statement. This was missed due to insufficient test coverage, which has
now been added for the [[likely]] and [[unlikely]] attributes.

The new approach is to check all of attributes that are to be applied
to the attributed statement in a group. This required generating
another DiagnoseMutualExclusions() function into AttrParsedAttrImpl.inc.




More information about the All-commits mailing list