Skip to content

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

Open
@ghehg

Description

@ghehg

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions