Skip to content

[CIRGen] Convert trivial copy constructor and assignment operator calls to memcpy #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Arthur-Chang016
Copy link
Contributor

No description provided.

If it's a trivial copy-constructable, emit the cir.copy directly
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR.

Some things that need improvements here:

  • Add a testcase (see others in clang/test/CIR for examples).
  • Follow the coding guidelines: https://llvm.github.io/clangir/GettingStarted/coding-guideline.html
  • Volatile: you need to detect whether it's volatile and add a llvm_unrecheable("NYI") (Not Yet Implemented) for it, so later on we can incrementally add volatile support and add the appropriated testcase.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending few minor nits

 - pull out the logic in emitCXXConstructorCall for copy construct only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants