[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 04:10:00 PST 2020


bader added a subscriber: Naghasan.
bader added a comment.

In D72362#1817682 <https://reviews.llvm.org/D72362#1817682>, @lebedev.ri wrote:

> In D72362#1817599 <https://reviews.llvm.org/D72362#1817599>, @bader wrote:
>
> > Does it make sense to implement such diagnostics in clang Sema, considering that OpenCL does not allow recursion?
> >  We implemented similar diagnostics for SYCL programming model and would be like to upstream it to clang later (https://github.com/intel/llvm/commit/4efe9fcf2dc6f6150b5b477b0f8320ea13a7f596). Can we somehow leverage this work for the compiler?
>
>
> Implementing it elsewhere will be more restrictive in the future - somehow i suspect
>  it will be easier to make clang-tidy CTU-aware rather than clang sema.
>
> That being said, is SYCL inherently single-TU, does it not support
>  linking multiple separately compiled object files together?


SYCL doesn't require multi-TU support. AFAIK, ComputeCPP implementation is signle-TU. + at Naghasan to confirm/clarify.
The open source implementation I referred to, does support linking separately compiled object files, but still I think detecting single-TU recursion in clang is very useful.
Is it possible to have both: intra-TU diagnostics in clang and inter-TU diagnostics in clang-tidy tool? Share any infrastructure (e.g. recursion detection)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72362





More information about the cfe-commits mailing list