ilya-biryukov added a comment.

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

> Currently the working directory is always the parent of `compile_flags.txt` 
> as you suggest.
>  Maybe this isn't great though - sometimes it might be important that the WD 
> is the parent of the source file?


Parent of the source file seems rather inconvenient most of the time. Even when 
reading the contents of `compile_flags.txt` one would have to consider it the 
contexts of every source file.

I'm looking at CompilationDatabase.cpp:321 
<https://reviews.llvm.org/diffusion/L/browse/cfe/trunk/lib/Tooling/CompilationDatabase.cpp;317699$321>
 and don't see the `CompileCommand::Directory` being set at all. Maybe I'm 
missing something.

A few ideas for tests:

1. Test relative include paths (`-Irelpath/to/include`) work.
2. What happens if both `compile_commands.json` and `compile_flags.txt` are 
present? Should we test and document it? I'd expect the first one to take 
priority and the second one to come into play only if the input file is not 
found in the first one.


https://reviews.llvm.org/D39799



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to