[PATCH] D129008: [Clang][OpenMP] Fix the issue that globalization doesn't work with byval struct function argument
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 25 20:16:53 PST 2023
rjmccall added a comment.
Right. C structs can require more than just `memcpy` to copy in several different situations (all involving language extensions), but it doesn't require Sema to be involved: it doesn't introduce uses of user declarations, and the compiler can figure out the work it needs to do with a straightforward recursive inspection of the field types, so IRGen just synthesizes those operations automatically when requested. Neither condition holds in C++, so Sema has to synthesize a copy expression which resolves the correct copy constructor and sets up any extra arguments it might require, triggering appropriate diagnostics and/or tracking of used decls. There are a bunch of places we do that for various language extensions already, including a bunch in the OpenMP code, and we usually just store the expression in the associated AST node.
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