[PATCH] D60161: Expose non-trivial struct helpers for Swift.

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 9 22:42:39 PDT 2019


ahatanak added a comment.

Just one minor comment, but otherwise the patch looks good to me.



================
Comment at: clang/include/clang/CodeGen/CodeGenABITypes.h:92
+llvm::Function *generateNonTrivialCStructDefaultConstructor(CodeGenModule &GCM,
+                                                            CharUnits Alignment,
+                                                            bool IsVolatile,
----------------
The parameter name is different from the one that is used in the function definition (`CharUnits DstAlignment`). Ditto for `generateNonTrivialCStructDestructor`.


================
Comment at: clang/lib/CodeGen/CGNonTrivialStruct.cpp:845
+  // actually use them (it overwrites them with the addresses of the arguments
+  // of the created function).
+  return Gen.getFunction(FuncName, QT, createNullAddressArray<N>(), Alignments,
----------------
I think `getFunction` shouldn't require passing addresses, but that's not this patch's fault. I'll see if I can remove the parameter. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60161





More information about the cfe-commits mailing list