llvmlite icon indicating copy to clipboard operation
llvmlite copied to clipboard

Add flag to IRBuilder.if_else to control whether an "endif" block should be created

Open thomaspinckney3 opened this issue 1 year ago • 0 comments


Feature request

When using the IRBuilder.if_else utility the endif block is always created. However, if there are no instructions following the if/else then this turns into an empty block. For example, the following C code results in an empty endif block.

int func() {
    if (something) {
          return 1;
    } else {
          return 2;
    }
}

thomaspinckney3 avatar Feb 03 '24 20:02 thomaspinckney3