[PATCH] D73290: [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

Nemanja Ivanovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 10:16:36 PDT 2020


nemanjai accepted this revision.
nemanjai added a comment.

Aside from a couple of minor nits that shouldn't require another review, LGTM.



================
Comment at: clang/docs/ClangCommandLineReference.rst:2631
+
+Override the default ABI for 32-bit targets to return small structs in
+registers, as in the System V ABI (1995).
----------------
Can you specify that "small" means 8 bytes or smaller?


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:4378
+    const llvm::Triple &Triple, const CodeGenOptions &Opts) {
+  assert(Triple.getArch() == llvm::Triple::ppc);
+
----------------
Please add text to the assert to help anyone who ends up tripping it. Perhaps:
```
assert(Triple.getArch() == llvm::Triple::ppc &&
       "Invalid triple for a 32-bit PowerPC target");
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73290





More information about the cfe-commits mailing list