[Qt-creator] clang branch

Erik Verbruggen erik.verbruggen at me.com
Fri Nov 23 08:46:49 CET 2012

On Nov 18, 2012, at 20:55, Sergey Shambir <sergey.shambir.auto at gmail.com> wrote:

> Hello all,
> First, thanks to Eric Verbuggen who did perfect clang-based code model and continues research in git branch. However, as i heard, he also busy in master branch and v4vm. I'm sure that community can help with clang initiative, but individual programmers have no enough information about branch status, problems or interesting tasks and even about any brainstorm results. Can this gap be filled at qt-project wiki?

Good idea! I'll try to do that today. Sneak-peek replies below.

> There are several questions which will be nice to clarify at wiki:
> 1) What libclang version is minimal requirement? Clang 3.2 will be released only in december, but it already has nice API for accessing doxygen comments and retrieving @brief comments for completion proposals. Possible solution is macro with LLVM version:
>     LLVM_VERSION = $$system($$LLVM_CONFIG --version)
> but i can't figure out how to convert float "3.1" (returned by "llvm_config --version") into integer that can be compared by preprocessor.

There are now also a libclang (interface) version macros that you can use (CINDEX_VERSION_MAJOR / _MINOR).

> 2) libclang is well designed and documented so clang branch has many "easy-hack" tasks that can be done by anyone - i mean testing on real code and fixing small errors/regressions. It will be nice to have easy-hacks list: missed features, regressions with problematic code and test for things that already done.

Yup. Anything not in the code or wired up is not done. Exception is indexing, on which I'm hacking away.

> 3) What about live diagnostics displaying? Diagnostic message itself can be associated with QTextBlock, but should it underscore error like native parser or add items to Issues pan like several other IDEs?

Yes, it tries to do that, but the range conversion is "a bit" buggy. Feel free to fix it :)

> 4) Clang is slow, so it's better to document any optimization idea at qt-project wiki.
>  - Pch still not used; and there can be some problems with reading previously generated *.pch - i've seen a few posts on stackoverflow and failed to read generated pch myself.

Long story short: I'll put in the option to use a pch with libclang back in later.

>  - Higlighting can be done for visible area first, as Eric mentioned once in this maillist

Slightly tricky because of the way highlighting is handled in the text editor (because of performance).

>  - When user starts typing characters sequence that can be identifier, IDE can take document snapshot, ask completions at position before first character and show proposals immediately after 1) they will be ready 2) user will enter 2-3 characters. Seems XCode uses this trick.

Interestring.. I'll take another look at Xcode.

> 5) Real optimizations can be done only in clang, but interesting directions can be mentioned at wiki too
>  - Now QtCreator replaces dot with arrow for pointer types, but it cannot be done through clang-c API without big overhead. Similar features: replace dot with :: for namespaces/type names; show mixed proposals for smart pointers

I had a patch to do the access-operator hinting in libclang, but it's kinda very stale. I might revive that in the near future.

>  - Despite that incremental compilation of C++ is horrible challenge, clang developers mentioned: „that's certainly a long-term goal“

Yes, I'm aware of that.

-- Erik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20121123/883012df/attachment.html>

More information about the Qt-creator mailing list