efriedma-quic wrote:

The clang patch was written the way it was because it was necessary to comply 
with the ABI rules.  Strings passed to printf don't have any sort of alignment 
requirement, so you can't really appeal to the ABI rules here, I think?

The problem with copying the alignment is that we don't really have any reason 
to believe the alignment of the original string is actually appropriate.

For the original patch, I think the comment was that the patch was equivalent 
to *deleting* the setAlignment() call.  And we really don't want to set the 
alignment that high; the current getPreferredAlign() prefer higher alignment.  
Maybe `GV->setAlignment(M->getDataLayout().getPrefTypeAlign(getInt8Ty()));` 
would be okay, though.

https://github.com/llvm/llvm-project/pull/142346
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to