[Chapel Merge] Use Clang ABI Info to pass extern records by point

Branch: refs/heads/main
Revision: c404538
Author: benharsh
Link: Use Clang ABI Info to pass extern records by pointer on M1s by benharsh · Pull Request #20270 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #20270 from benharsh/clang-abi-m1

Use Clang ABI Info to pass extern records by pointer on M1s

Issue #19218 describes a problem where the fileIO primer fails to successfully run on M1 machines under LLVM. The problem appears to be that LLVM is generating incorrect assembly when passing sufficiently large structs by value (and when optimizations are turned off).

This PR works around the underlying issue by querying ABI information from Clang, and providing that information to the existing codegen logic that determines whether such actuals/formals should use a pointer.

This PR also restores CHPL_LLVM=system as a compatible option for M1 systems, and removes the suppressif on the fileIO primer.

[reviewed-by @mppf]

Modified Files:
R test/release/examples/primers/fileIO.suppressif

M compiler/codegen/cg-expr.cpp
M compiler/codegen/cg-symbol.cpp
M compiler/include/clangUtil.h
M compiler/llvm/clangUtil.cpp
M util/chplenv/chpl_llvm.py

Compare: https://github.com/chapel-lang/chapel/compare/88278433306e...c404538e265f