[Qt-creator] preprocessor parsing and #include

thorbjorn.lindeijer at nokia.com thorbjorn.lindeijer at nokia.com
Tue Jan 20 12:29:12 CET 2009


________________________________________
Van: qt-creator-bounces at trolltech.com [qt-creator-bounces at trolltech.com] namens ext Marek Jasovsky [jasovsky.marek at gmail.com]
Verzonden: dinsdag 20 januari 2009 11:32
Aan: qt-creator at trolltech.com
Onderwerp: Re: [Qt-creator] preprocessor parsing and #include

> grazie
>
> could you give me some hints how this could be implemented? I can
> imagine you would not like to have this in release code, and so
> far I have not found a way how to do this without breaking
> client->sourceNeeded method. I spent almost 3 hours debugging
> this stuff before Thorbjorn pointed me to the idea, that you are
> not doing full type check on parsing.
>
> can you imagine having this as a option in project settings?

Doing a full type check is a slow process, and probably not something we'd want to do while parsing, but rather as a second pass after the CPlusPlus::Documents have been created. The code completion is an example of such a second pass. Processing the whole document that you're working on in order to provide feedback about unresolved types or missing methods is something we'd like to do in the future.

> actually... what was the purpose of this one? client->sourceNeeded() ?

Seems to me this is called whenever the preprocessor encounters an include directive. If this include file hasn't been parsed yet, it will parse it, otherwise it will merge the environment (importing macros) from an already parsed version.

> could you imagine having preprocessed headers stored somewhere?
> so that most of framework files do not have to be checked / parsed
> why checking code, that is changed often.

All the included files are already stored as separate CPlusPlus::Documents, and easily obtainable. Note that there is no need for the creation of a combined CPlusPlus::Document that would have everything from the included files in it as well, since each document tells you already which other files are included.

Btw, please do understand Roberto is currently on holiday. It would be better to wait with addressing questions to him personally until he's back at work, starting February.

Regards,
Bjørn




More information about the Qt-creator-old mailing list