[cfe-dev] Regarding transformation with clang format

Michael Kruse via cfe-dev cfe-dev at lists.llvm.org
Thu Apr 18 07:31:58 PDT 2019


This sounds more like a job for clang-tidy
(https://clang.llvm.org/extra/clang-tidy/)

Michael

Am Do., 18. Apr. 2019 um 06:47 Uhr schrieb kamlesh kumar via cfe-dev
<cfe-dev at lists.llvm.org>:
>
> Hi all,
>
> Consider below case
> $cat test.c
> bool foo=false;
> if(foo == false)
> {}
> and with clang-format tool we would like to transform it into
> ---------
> bool foo = false;
> if(foo)
> {}
> ------------
> There are other cases  where we want  transformation like, ternary operator into if else, do not want use keywords like continue,goto ,and do not want recursive calls with unknown depth etc.
>
> is this doable with clang-format?
>
> Incase  if this transformation can not be done by clang-format ,
> can clang-format be extended to atleast error it out when cases like this are detected?
>
> ./Kamlesh
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list