ABataev added a comment. In D129008#4079914 <https://reviews.llvm.org/D129008#4079914>, @tianshilei1992 wrote:
> In D129008#4079892 <https://reviews.llvm.org/D129008#4079892>, @ABataev wrote: > >> In D129008#4079872 <https://reviews.llvm.org/D129008#4079872>, >> @tianshilei1992 wrote: >> >>> In D129008#4079660 <https://reviews.llvm.org/D129008#4079660>, >>> @aaron.ballman wrote: >>> >>>> 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. >>> >>> That's not ObjC. It can be C or C++. >>> >>> My apology I should have added more context here. In OpenMP, we need to >>> "globalize" certain captured local variables by allocating another buffers >>> and then copy the memory. If the local variables are structs or even C++ >>> classes, the copy has to be done by invoking the corresponding copy >>> constructors. However, I don't know how to invoke the copy constructor >>> here. `callCStructCopyConstructor` only does plain copy. It's not gonna >>> work for C++ classes. >> >> You need to do it manually. Usually we built the required copy constructor >> call in Sema (it requires correct lookup) and then emitted it in codegen. > > But we don't do globalization in Sema right? Right. If we really needed the constructor call, we emitted special helper expressions/statements and stored them in the associated construct/clause, and then emitted it, if required. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129008/new/ https://reviews.llvm.org/D129008 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits