Generate coverage mappings for <init> in if (<init>; <cond>).
Here's some sample output (let's hope phab gets the spaces right :) --
12| |// CHECK-LABEL: define {{.*}}void @_Z11switch_initv() 13| |// PGOGEN: store {{.*}} @[[SIC]], i64 0, i64 0 14| 1|void switch_init() { 15| 1| switch (int i = true ? 0 : 1; i) {} ^1 ^0 16| 1| // PGOGEN: store {{.*}} @[[SIC]], i64 0, i64 2 17| 1| // PGOGEN: store {{.*}} @[[SIC]], i64 0, i64 1 18| 1|} 19| | 20| |// Note: We expect counters for the function entry block, the condition in the 21| |// if initializer, and the if successor block. 22| |// 23| |// CHECK-LABEL: define {{.*}}void @_Z7if_initv() 24| |// PGOGEN: store {{.*}} @[[IIC]], i64 0, i64 0 25| 1|void if_init() { 26| 1| if (int i = true ? 0 : 1; i) {} ^1 ^0 ^1 ^0 27| 1| // PGOGEN: store {{.*}} @[[IIC]], i64 0, i64 2 28| 1| // PGOGEN: store {{.*}} @[[IIC]], i64 0, i64 1 29| 1|}
I did some local testing of this patch (as well as D25539) using a maze of macros to generate parts of the IfStmt / SwitchStmt. The goal of that exercise was to break popRegions(). Ultimately I decided against checking those tests in because they seem a bit paranoid. We're not actually pushing new regions for the initializer statements..