Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Clang command line support for codecompletion
ironhead:
--- Quote from: ollydbg on October 27, 2010, 08:15:35 am ---BTW: seems all the tokens were handled as char type.(one byte). Hope our CC can use char type instead. because wxChar seems waste a lot of space. (Unicode wxChar seems equal two bytes, not sure how long in X86-64 system).
--- End quote ---
This is limiting, isn't it? It would limit CC to be UTF-8 compliant at best (i.e. not truly Unicode).
As far as I know, Unicode is a two-byte sequence irregardless of architecture.
oBFusCATed:
sizeof(wchar_t) is 4 on MacOSX.
Using non ASCII characters in the sourcecode/sourcefiles is highly discouraged anyway...
eranif:
BTW: As promised, here are the build instruction for building clang under Windows / MinGW
--- Quote ---Important notes:
----------------
MinGW\bin directory must be in the PATH environment variable
Install CMAKE from here:
------------------------
http://www.cmake.org/cmake/resources/software.html
Building clang using MinGW:
--------------------------
- Checkout llvm sources : svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
- cd llvm/tools directory : svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
- create a build directory under the root llvm directory (.e.g mkdir build_release)
- cd to the build directory (e.g. cd build_release) and run : cmake -G "MinGW Makefiles" ../ -DCMAKE_BUILD_TYPE=Release
- open the file CMakeCache.txt and reduce the optimizatin level from -O3 to -O2 (replace all -O3 to -O2)
- Open the file llvm\tools\clang\tools\c-index-test\CMakeLists.txt and comment out the following lines:
#add_clang_executable(c-index-test
# c-index-test.c
# )
#set_target_properties(c-index-test
# PROPERTIES
# LINKER_LANGUAGE CXX)
- Run : mingw32-make
To update sources from svn, you need to update both repositories, so:
--------------------------------------------------------------------
from the root directory, run: svn up
cd to tools/clang and run : svn up
--- End quote ---
Eran
ollydbg:
thanks eranif for the information!!!
seems c-index-test has some problems ( I failed building this target the day before yesterday :D) see build failed method two..
It seems we don't have perl to build clang. (as the http://llvm.org/docs/GettingStarted.html#requirements said, under MSYS, perl is need), but the cmake+mingw method, perl is not need.
BTW:
As this post said:
http://lists.trolltech.com/pipermail/qt-creator/2009-January/001329.html
In QT creator, they use two kind of parser.
let's say, a simple parsing and a detailed parsing.
When QTcreator analysis the whole project files, it just do the simple parsing. this is the same way as we do in C::B's CC parser. or the Codelite's ctags parser. it just correct tags.
But QTcreator will do a detailed parsing on the current active translation unit. including the type checking, macro expansion...So, the error information can be shown, and a more precise code-completion list can be generated.
As this way: we can just use clang do the "detailed parsing" and left the other thing still to CC's parser or ctags. Any ideas?
eranif:
Actually, for codelite I took another path:
- All code completion goes through the current parser code
- In case the current parser fails to parse / yield results, the clang code completion "kicks in"
I think that this is the best option in terms of stability and backward compatibilty
I believe in making evolution, not a revolution :D
Eran
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version