[PATCH] D66404: [CFG] Make destructor calls more accurate

Nathan Chancellor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 00:24:22 PDT 2019


nathanchance added a comment.

This commit causes some warnings in the Linux kernel that appear to be false positives. For example:

    CC      drivers/base/cpu.o
  drivers/base/cpu.c:404:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
  }
  ^
  1 error generated.

Corresponds to this function <https://github.com/torvalds/linux/blob/v5.3-rc6/drivers/base/cpu.c#L398-L404>:

  struct device *get_cpu_device(unsigned cpu)
  {
  	if (cpu < nr_cpu_ids && cpu_possible(cpu))
  		return per_cpu(cpu_sys_devices, cpu);
  	else
  		return NULL;
  }

creduce spits out:

  a() {
    if (b())
      return ({
        while (0)
          ;
        0;
      });
    else
      return 0;
  }


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66404/new/

https://reviews.llvm.org/D66404





More information about the llvm-commits mailing list