[PATCH] D23160: [Coverage] Prevent creating a redundant counter if a nested body ends with a macro.

Igor Kudrin via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 5 06:09:40 PDT 2016


ikudrin added a comment.

I've reduced the last sample to the following:

      0|    1|void dummy() {}
       |    2|
      0|    3|#define MACRO_1 dummy()
       |    4|
      1|    5|#define MACRO_2 MACRO_1
       |    6|
      1|    7|int main() {
      1|    8|  int i = 0;
      1|    9|  if (i > 5)
      1|   10|    MACRO_2;
  ------------------
  |  |      1|    5|#define MACRO_2 MACRO_1
  |  |  ------------------
  |  |  |  |      0|    3|#define MACRO_1 dummy()
  |  |  ------------------
  ------------------
      1|   11|  return 0;
      1|   12|}

Right now, I don't have a good idea how to fix this.


https://reviews.llvm.org/D23160





More information about the cfe-commits mailing list