[PATCH] D118350: [Clang][Sema][AIX][PowerPC] Emit byval alignment warning only when struct member is passed to a function

Zarko Todorovski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 28 13:29:16 PST 2022


ZarkoCA added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:12693-12695
   void CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl,
-                         StringRef ParamName, QualType ArgTy, QualType ParamTy);
+                         StringRef ParamName, QualType ArgTy, QualType ParamTy,
+                         const Expr *Arg = nullptr);
----------------
aaron.ballman wrote:
> I'm not keen on passing both `Arg` and `ArgTy` such that they can get out of sync. Do all of the places calling `CheckArgAlignment()` have access to the `Expr` so that we can require it be passed (and drop the `ArgTy` parameter)?
Thanks, that is something I overlooked. 

It seems like I can do this everywhere except the call from `Sema::CheckConstructorCall`. Trying to figure out whether it's something I'm missing. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118350



More information about the cfe-commits mailing list