jfb added a comment.

In D59254#1566895 <https://reviews.llvm.org/D59254#1566895>, @shawnl wrote:

> My point is that most languages these days that intend to be compiled to 
> machine code want compatibility with the C ABI, and randstruct will be part 
> of that (and can be made compatible between languages by sharing the seed). 
> LLVM knows what a struct is.


Basic stuff, sure LLVM can know about and move fields around, especially if 
clang slaps an attribute on the struct saying it's fine.

However, struct layout is deeply ingrained in code generation. Too deeply to 
just move it to LLVM. Consider this simple example:

  template <int Size>
  struct Arr {
      int arr[Size];
  };
  
  struct A { int a, b, c; char d, e, f, g; };
  
  Arr<__builtin_offsetof(A, d)> arr;

There's way more complex stuff that falls out of how C and C++ specify the 
language. That complexity really shouldn't be in scope for this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59254



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to