[PATCH] D142327: [clang][RISCV] Fix ABI handling of empty structs with hard FP calling conventions in C++

Luís Marques via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 23 04:13:17 PST 2023


luismarques accepted this revision.
luismarques added a comment.
This revision is now accepted and ready to land.

LGMT.



================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:591
   if (isa<CXXRecordDecl>(RT->getDecl()) &&
-      (WasArray || !FD->hasAttr<NoUniqueAddressAttr>()))
+      (WasArray || (!FD->hasAttr<NoUniqueAddressAttr>() && !AsIfNoUniqueAddr)))
     return false;
----------------
Nit: the `!AsIfNoUniqueAddr` condition could be tested before the `!FD->hasAttr<NoUniqueAddressAttr>()` condition, and I imagine that would be slightly cheaper for the `AsIfNoUniqueAddr = true` case?


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

https://reviews.llvm.org/D142327



More information about the cfe-commits mailing list