Skip to content

Commit

Permalink
print: deal with anonymous BBs properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugobros3 committed Apr 27, 2024
1 parent 39cad27 commit b5552d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/shady/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ static void print_basic_block(PrinterCtx* ctx, const Node* bb) {
printf(GREEN);
printf("\n\ncont");
printf(BYELLOW);
printf(" %s", bb->payload.basic_block.name);
if (bb->payload.basic_block.name && strlen(bb->payload.basic_block.name) > 0)
printf(" %s", bb->payload.basic_block.name);
else
printf(" %%%d", bb->id);
printf(RESET);
if (ctx->config.print_ptrs) {
printf(" %zu:: ", (size_t)(void*)bb);
Expand Down Expand Up @@ -948,7 +951,10 @@ static void print_node_impl(PrinterCtx* ctx, const Node* node) {
}
case BasicBlock_TAG: {
printf(BYELLOW);
printf("%s", node->payload.basic_block.name);
if (node->payload.basic_block.name && strlen(node->payload.basic_block.name) > 0)
printf("%s", node->payload.basic_block.name);
else
printf("%%%d", node->id);
printf(RESET);
break;
}
Expand Down

0 comments on commit b5552d1

Please sign in to comment.