[PATCH] D84992: [clang codegen] Use IR "align" attribute for static array arguments.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 12:39:51 PDT 2020


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:2503
+              llvm::Align Alignment =
+                  CGM.getNaturalTypeAlignment(ETy).getAsAlign();
+              AI->addAttrs(llvm::AttrBuilder().addAlignmentAttr(Alignment));
----------------
Is it reasonable to assume that this is an array of complete objects, or do we need to worry about someone doing e.g.

```
class A : virtual HighlyAligned { char buffer[16]; ];

void foo(A[static 1]);
```

This isn't completely disabled in C++ mode, is it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84992



More information about the cfe-commits mailing list