llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
351 stars 95 forks source link

[CIR][CIRGen] Create a new block after break and continue #611

Closed piggynl closed 4 months ago

piggynl commented 4 months ago

Without this patch, CIR CodeGen continue to generate in the same block after cir.break and cir.continue, which would cause verification error because cir.break and cir.continue should appear at the end of blocks.

This patch creates a new dangling block after generating cir.break and cir.continue to fix the issue.

This will fix #323.

bcardosolopes commented 4 months ago

I'm going to resume reviewing this, sorry for the delay!