Review Request 121649: For headers, also use source-file include paths and defines.

Nicolai Hähnle nhaehnle at gmail.com
Fri Dec 26 16:38:02 UTC 2014



> On Dez. 23, 2014, 5:40 nachm., Nicolai Hähnle wrote:
> > duchain/clangparsingenvironment.cpp, lines 43-45
> > <https://git.reviewboard.kde.org/r/121649/diff/1/?file=335505#file335505line43>
> >
> >     This is an O(n^2) algorithm, isn't it? I'm working on a project where we have ~30 custom include paths; 30^2 isn't gigantic, but still - if there's a simple alternative that is not O(n^2) (and I admit that I don't see one yet), then that should be taken.
> 
> Milian Wolff wrote:
>     a set or unordered_set cannot be used as the order is important. maybe I'll have to rewrite it all to check whether we get any paths back for the header, and if not, just use all of the source file. suggestions welcome. if this is really too slow, we could also not filter at all and just let clang handle it internally. or we could add a hash set for checking whether we want to add it and another for the ordered list - that is probably the most efficient way to do this.

I don't feel very strongly over this. Though I do wonder whether perhaps the right place to fix this would be the CMake project plugin, given also what Kevin pointed out about header files that do not have an associated source file.


- Nicolai


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121649/#review72465
-----------------------------------------------------------


On Dez. 23, 2014, 5:28 nachm., Milian Wolff wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121649/
> -----------------------------------------------------------
> 
> (Updated Dez. 23, 2014, 5:28 nachm.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> We use the existing find-buddy-document architecture to find a
> source file corresponding to the current header file. If we find
> a match that also has a project file, we ask it for its include
> files.
> 
> This fixes an issue, where when editing a header file Clang would
> never find the include paths. The reason is that in e.g. CMake,
> only the .cpp files have include paths, but not the .h files.
> 
> 
> Diffs
> -----
> 
>   clangparsejob.cpp 297b836128c441a7f6aacbac7ec175ca4bf7b8e1 
>   duchain/clangparsingenvironment.cpp 1decc1493eba5b81d18937ce43dd5c24ea6db01f 
> 
> Diff: https://git.reviewboard.kde.org/r/121649/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Milian Wolff
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20141226/8fe000f3/attachment.html>


More information about the KDevelop-devel mailing list