[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 05:55:05 PST 2023


aaron.ballman added subscribers: efriedma, rjmccall.
aaron.ballman added a comment.

In D129008#3640194 <https://reviews.llvm.org/D129008#3640194>, @tianshilei1992 wrote:

> `callCStructCopyConstructor` is actually for Objective-C…Cannot use it here.

Is it for ObjC? Looking at the comments, it looks like it's for C:

  // These functions emit calls to the special functions of non-trivial C
  // structs.



================
Comment at: clang/lib/CodeGen/CGDecl.cpp:2501
+      LValue Src = MakeAddrLValue(Arg.getIndirectAddress(), Ty);
+      callCStructCopyConstructor(Dst, Src);
+      PushCleanupIfNeeded(Arg.getIndirectAddress());
----------------
tianshilei1992 wrote:
> Hi @aaron.ballman, is it possible to invoke the copy constructor of a struct/class here, either it is user defined or default one?
CC @rjmccall and @efriedma for codegen owner opinions.

I'm honestly not certain; I would imagine that OpenMP defines what should happen, but this is outside of my area of expertise.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129008



More information about the cfe-commits mailing list