Skip to content
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

LLVM Lowering: support for cir.delete.array #1285

Open
ghehg opened this issue Jan 16, 2025 · 0 comments
Open

LLVM Lowering: support for cir.delete.array #1285

ghehg opened this issue Jan 16, 2025 · 0 comments
Labels
good first issue Good for newcomers libcxx

Comments

@ghehg
Copy link
Collaborator

ghehg commented Jan 16, 2025

The following code fails to compile, which is reduced from libcxx code.

int *newmem();
struct cls {
  ~cls();
};
cls::~cls() { delete[] newmem(); }

error
failed to legalize operation 'cir.delete.array' that was explicitly marked illegal

It is because we do not have a lowering prep implementation for cir.delelte.array, once we have it, we should be able to compile this. Not sure for this simple case, array cookie info is needed, but in general, it is needed for ABI lowering cir.delelte.array.

Create this issue so that we can track implementation as it would help ClangIR build libcxx

@ChuanqiXu9, keep you in the loop as you introduced cir.delelte.array in #1172, I understand that you guys don't need it to be lowered for analysis purpose, but you might be interested if someone in community picks it up.

@ghehg ghehg added the libcxx label Jan 16, 2025
@ghehg ghehg changed the title [CXX] array delete not implemented [CXX] lowering of array delete not implemented Jan 16, 2025
@bcardosolopes bcardosolopes changed the title [CXX] lowering of array delete not implemented LLVM Lowering: support for cir.delete.array Jan 16, 2025
@bcardosolopes bcardosolopes added the good first issue Good for newcomers label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers libcxx
Projects
None yet
Development

No branches or pull requests

2 participants