[PATCH] D99896: Rework the way statement attributes are processed; NFC

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 5 14:50:52 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/TreeTransform.h:1316
                                    Stmt *SubStmt) {
-    return SemaRef.ActOnAttributedStmt(AttrLoc, Attrs, SubStmt);
+    return SemaRef.BuildAttributedStmt(AttrLoc, Attrs, SubStmt);
   }
----------------
haberman wrote:
> aaron.ballman wrote:
> > erichkeane wrote:
> > > Am I missing where the attributes themselves are being rebuilt/transformed??  
> > > 
> > > 
> > The transformation happens in `TreeTransform<Derived>::TransformAttributedStmt()` which calls `RebuildAttributedStmt()` with the rebuilt attributes.
> It appears that neither `TransformAttributedStmt()` nor `RebuildAttributedStmt()` calls `ProcessStmtAttributes()`, either directly or transitively, so I'm not seeing where we can run instantiation-time attribute processing logic. What am I missing?
My thinking is: 

* From `handleMustTailAttr()` in SemaStmtAttr.cpp, call `CheckMustTailAttr()` to do the shared semantic checking.
* Add a `TransformMustTailAttr()` to `TreeTransform`, have it call `SemaRef.CheckMustTailAttr()` as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99896/new/

https://reviews.llvm.org/D99896



More information about the cfe-commits mailing list