[cfe-dev] Fwd: Running Clang-Tidy on a Large Project

Ahmad Nouralizadeh via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 19 11:34:21 PDT 2018

Hi Miklos,

The compilation database is correct. It is generated using Bear. It has
correct directory (for the build directory) and file (for the file to be
compiled) entries.
The tool works correctly with single file. I think because the absolute
path is recreated in that case. It can be seen at "clang-extra-tools-source/
clang-tidy/ClangTidy.cpp:line131" (clang-extra-tools-6.0.0):

SmallString<128> FixAbsoluteFilePath = Repl.getFilePath();

But the same operation is not performed when the information is exported to
yaml, which is done when I run "run-clang-tidy" script with "-fix" option.
It seems that the problem with large projects is not new. There was a bug
in clang-extra-tools-3.9.0 "run-clang-tidy" script which is revised in the
current version. In that version, even clang-tidy was called with relative
paths and therefore did not work for source files built from somewhere
other than the root directory of the project. Looking forward to your

On Thu, Jul 19, 2018 at 8:07 PM, Miklos Vajna via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
> On Thu, Jul 19, 2018 at 03:55:16PM +0430, Ahmad Nouralizadeh via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
> > Ignoring...Described file 'libavformat/apngdec.c' doesn't exist.
> > Ignoring......
> >
> > These files are compiled using the Makefile located in the folder ffmpeg.
> See <https://clang.llvm.org/docs/JSONCompilationDatabase.html>, you
> either need to have absolute paths in your compile commands database or
> you need to have a matching directory key. Are those correct in your
> case?
> Regards,
> Miklos
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180719/8f0a0f44/attachment.html>

More information about the cfe-dev mailing list