[PATCH] D39799: [Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 8 09:31:09 PST 2017


ilya-biryukov added a comment.

In https://reviews.llvm.org/D39799#919494, @sammccall wrote:

> e.g. IIUC, things like `#include "sibling.h"` won't look for the h file next to the cc file?


Actually, this should work as quoted includes are always searched relative to the current file before looking in the include paths. No matter what the WD is.

> `Result` is initialized with a copy of `CompilerCommands`, whose element is initialized with the directory passed to the constructor.

Missed that, thanks!

> Ideally yes... i'm not sure this is so easy with the registry mechanism though :-(
>  They'd have to be present at the same level, so I'm not sure this is a huge deal.

Yeah, looks like this would require unifying `FixedCompilationDatabase` and `JSONCompilationDatabase`. This doesn't seem too crazy, though. "A class that handles reading compilation arguments from the filesystem." seems like a valid entity to me.


https://reviews.llvm.org/D39799





More information about the cfe-commits mailing list