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

Miklos Vajna via cfe-dev cfe-dev at lists.llvm.org
Fri Jul 20 00:23:34 PDT 2018


Hi,

On Thu, Jul 19, 2018 at 11:04:21PM +0430, Ahmad Nouralizadeh <ahmadnouralizadeh at gmail.com> wrote:
> 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();
> 
> Files.makeAbsolutePath(FixAbsoluteFilePath);
> ...
> 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.

Sounds like if you submit a patch to fix this, it would makes sense. (I
haven't tried run-clang-tidy with -fix myself; what I usually do is
invoking clang-tidy directly with -export-fixes=, then
clang-apply-replacements, but in theory this is the same.)

Perhaps the reason why nobody hit this before is the usage of relative
paths; I think cmake just writes absolute paths in the compile commands
db, so you don't hit the codepath where making the paths absolute
matters.

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180720/ed78c0ac/attachment.sig>


More information about the cfe-dev mailing list