[Qt-creator] Clang utilities (was: include cleaner)

Erik Verbruggen erik.verbruggen at digia.com
Tue Dec 10 12:01:33 CET 2013


On 3-12-2013 15:07, Sergey Shambir wrote:
> 03.12.13, 13:19, Mateusz Loskot пишет:
>> On 3 December 2013 09:14, Przemyslaw Gorszkowski <pgorszkowski at gmail.com> wrote:
>>> Another thing which can be use here from
>>> Clang(https://code.google.com/p/include-what-you-use needs Clang) is Clang
>>> Tools(e.g.: Clang C++ Modernizer:
>>> http://clang.llvm.org/extra/clang-modernize.html,
>>> http://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s-Dragons).
>> Another one is ClangFormat and its LibFormat, as AStyle replacement
>>
>> http://clang.llvm.org/docs/ClangFormat.html
>>
>>
>>> Due to the fact that both base on Clang probably it should be consider in
>>> WIP/Clang branch.
>> BTW, who is the current maintainer of this branch?
>>
>> Best regards,
> Erik Verbruggen is maintainer.

Yup, that's me.

> One of clang disadvantages is that its parser cannot work when file
> contains errors. If one of important include paths is missed, some
> include will be not resolved and clang will meet fatal error, so
> formatting will fail.

Nope, clang-format only uses the lexer from clang, not the parser. The 
reason for that is exactly what you state. (They tried it with the 
parser at first though.) Actually, it can even format example code 
snippets inside comments.

> In other cases it should work OK, but a few months ago all ClangFormat
> style rules was hardcoded into its sources - so set of available styles
> is very limited (I'm not sure if it bug or feature :)) ).

-- Erik.




More information about the Qt-creator mailing list