[all-commits] [llvm/llvm-project] 971111: Rework the way statement attributes are processed; ...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Mon Apr 5 14:52:41 PDT 2021


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

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Parse/ParseStmt.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/lib/Sema/SemaStmtAttr.cpp
    M clang/lib/Sema/TreeTransform.h

  Log Message:
  -----------
  Rework the way statement attributes are processed; NFC

This changes our approach to processing statement attributes to be more
similar to how we process declaration attributes. Namely,
ActOnAttributedStmt() now calls ProcessStmtAttributes() instead of
vice-versa, and there is now an interface split between building an
attributed statement where you already have a list of semantic
attributes and building an attributed statement with attributes from
the parser.

This should make it easier to support statement attributes that are
dependent on a template. In that case, you would add a
TransformFooAttr() function in TreeTransform.h to perform the semantic
checking (morally similar to how Sema::InstantiateAttrs() already works
for declaration attributes) when transforming the semantic attribute at
instantiation time.




More information about the All-commits mailing list