Commit Graph

56 Commits

Author SHA1 Message Date
Oswald Buddenhagen f53ed6c4b3 don't pretend that break()/next()/return() are functions
it's a pretty braindead thing to implement control flow statements as
(built-in) functions.

as a "side effect", this fixes return() value handling for lists.

Change-Id: I59c8efa0e4d65329327115f7f8ed20719e7f7546
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-12 17:05:20 +02:00
Oswald Buddenhagen f24c986530 update size calculations for assignment statements
this was forgotten when the value lists were extended by a size hint.

Change-Id: I6f9b55ed671224a9b8735c8d937f94aac4a73a42
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-09-07 19:59:04 +02:00
Oswald Buddenhagen 1c28c5df02 fix default arguments of ProString::lastIndexOf()
Change-Id: If70f4f8e2aa8b68b5c87dbd1b6b95a7601eecce8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-09-06 14:56:16 +02:00
Oswald Buddenhagen 2db6609556 beef up Pro* APIs
so they match the Q* counterparts more closely:

ProString: startsWith(), endsWith(), indexOf(), lastIndexOf(),
contains(), at(), length(), QTextStream::operator<<(), toLatin1(),
toInt() & toShort()

ProStringList: length(), removeAt(), contains()

Change-Id: Iab78236f7152f6a4b93709abbf59b9027c44ba2c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 14:37:28 +02:00
Oswald Buddenhagen 1f2189d5a0 don't pass QLatin1String by ref
it's pointless

Change-Id: Ia02762a1f79399970cbdf43b3b20e08b4e54fd3b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 14:36:35 +02:00
Oswald Buddenhagen 85dc06662e simplify ProString::operator==() implementations
we can trivially construct a QStringRef from a ProString, so take
advantage of that.

Change-Id: I9aaa1f6d910590872b250a145f16e90984beeb94
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 14:35:55 +02:00
Oswald Buddenhagen d97de7e43f make ProString c'tors explicit only when not building qmake
otherwise it's impossible to migrate the qmake generators to this.

Change-Id: I70c848da2ce428706b960c3c1434c26f7e3a9447
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 14:34:20 +02:00
Joerg Bornemann edd9279c8a fix release build on Windows with MSVC
We must work around strange MSVC behaviour when exporting classes
with ProKey members.

Change-Id: I56d56588a52523b1a15e432eb2d84c5c3b13c0f3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-07 13:50:58 +02:00
Oswald Buddenhagen bdd8cf300b introduce ProKey class
while this is actually just an alias for ProString (with explicit
zero-cost conversions only), it nicely illustrates the use of particular
variables. it also serves to hide the NoHash hack from public view.

Change-Id: Iaf9283c64f320ad84a77d9573d1fde6d401c49df
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-06 15:05:17 +02:00
Oswald Buddenhagen 7c10134437 add support for option(host_build)
Change-Id: I7b16d13b0f94d0a2e4b4743a40dad9bd8b8b9698
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-01 16:38:09 +02:00
Eike Ziller e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Oswald Buddenhagen 8d7546d006 allow setting QMAKEPATH and QMAKEFEATURES in .qmake.cache
follow suit with qmake ...

Change-Id: Idc957b607bbc87f92c8729946b208f9c24a23b4b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-09 21:18:12 +02:00
Oswald Buddenhagen da26368d9e make qmake property map ProString-based
Change-Id: I3c25642b885171a47e8fd27e39e5d470d9f24db3
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-09 21:14:40 +02:00
Oswald Buddenhagen 5a6625245b introduce ProValueMap typedef for brevity's sake
Change-Id: I41b7202acb2889d217d1f437050443bea853ee87
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-07-04 12:48:00 +02:00
Oswald Buddenhagen ed633945ba FunctionDef(s) => ProFunctionDef(s), plus move to proitems.h
Change-Id: I7bdde81c1913237f11dbfbe7491e0fe750181cd5
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-07-04 12:05:15 +02:00
Oswald Buddenhagen ff961351eb proparser => qmake
namely:
- proparser_global.h => qmake_global.h,
- PROPARSER_EXPORT => QMAKE_EXPORT
- PROPARSER_AS_LIBRARY => QMAKE_AS_LIBRARY
- PROPARSER_LIBRARY => QMAKE_LIBRARY

Change-Id: I6db1e6339b4dced59819f047874d84dff826f398
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-07-04 12:04:04 +02:00
Erik Verbruggen 3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
hjk 2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
hjk 31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
dt 754be1bcfc Move a lot of qmake independent classes to a new plugin qtsupport
Also adjust qmldumptool to remove the dependency on qt4project/qmlproject, by
passing in the qtversion instead of figuring it out in qmldumptool.

Change-Id: Ie6ac582d36bfef290313c0716b33b62fcf42630c
Reviewed-on: http://codereview.qt.nokia.com/70
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2011-05-24 18:35:11 +02:00
Oswald Buddenhagen 014571b602 improve value source tracking
- use the current file if a value is generated "out of nowhere"
- preserve source through function calls

Task-number: QTCREATORBUG-4897
2011-05-16 10:28:04 +02:00
Tobias Hunger aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Oswald Buddenhagen 5e23cf2968 eliminate m_filevaluemap by using source tagging
instead of having a second value map per included file, simply tag all
values with the project file they are coming from. a lot cleaner and
marginally faster.
2011-04-20 19:44:31 +02:00
hjk 8397663964 Update license. 2011-04-13 11:49:28 +02:00
Oswald Buddenhagen e77c2f5a8b don't give up on parsing errors
instead of erroring out the parse, only error out the evaluation in
exact mode. that way we can do cumulative evaluation even on broken
files.

Task-number: QTCREATORBUG-3093
2011-02-10 14:56:15 +01:00
con d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
con 04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Oswald Buddenhagen a49d1bffcb add ProFile::tokPtr(): centralize nasty cast 2010-06-24 15:44:37 +02:00
Oswald Buddenhagen fa79b97511 don't strip path from $$_FILE_ for even for included files
catch up with the recent change in qmake
2010-06-24 15:44:37 +02:00
Oswald Buddenhagen 619d830d6a f******ck .... revert "deeeeebug"
This reverts commit 47885c114b.
2010-06-14 14:43:00 +02:00
Oswald Buddenhagen 47885c114b deeeeebug 2010-06-14 12:45:10 +02:00
Oswald Buddenhagen a1fa00d2e7 precompile expressions
this gives a rather significant boost, in particular for
expressions which are evaluated repeatedly (includes).
2010-06-02 11:05:27 +02:00
Oswald Buddenhagen a8d53e0ae3 serialize AST into a single string
this saves quite some mallocs in the parsing pass.
2010-06-02 11:05:27 +02:00
Oswald Buddenhagen 0b0bbff094 move and rename ProItemReturn to VisitReturn
it's private to ProFileEvaluator::Private since the getting rid of
the visitor pattern.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen 5db91cf5bc add custom string type
ProString is almost a QStringRef, except that it keeps a copy of instead
of a pointer to the QString - to make it refcountable. additionally, it
holds a hash so it can be efficiently used for repetetive hash lookups.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen 8df0fe8632 remove unused setters 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen c63453d878 reorganize AST
turn else, for(), defineTest() and defineReplace() into own node
types instead of treating them as magic conditionals/functions.
on top of that, introduce a proper branching node type, so finding
the alternative code paths can be moved into the parser instead of
burdening the evaluator with it.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen f1b591bb06 merge ProFunction into ProCondition
there is no point in the split, given that there is nothing virtual any
more.
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen 79fd001aff fix memleak, part 2
the previous fix did not consider that ProFiles are a further
specialization of ProBlocks.

Reviewed-by: dt
Task-number: QTCREATORBUG-1003
2010-04-01 16:29:38 +02:00
hjk 9595504bda Long live the king! 2010-03-05 11:28:13 +01:00
Oswald Buddenhagen e22e8035c6 make profile cache thread safe
Reviewed-by: thiago
2010-02-26 13:09:20 +01:00
Oswald Buddenhagen b309f9449a directly link ProItems instead of using QList<ProItem*>
somewhat faster again
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen 9341f7da4e de-virtualize ProItem::kind(); use variable instead
now items have no vtable any more
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen 143531289e inline trivial functions 2010-02-05 15:20:25 +01:00
Oswald Buddenhagen 42fd31fb12 remove unused functions 2010-02-05 15:20:25 +01:00
Oswald Buddenhagen a2dbeecdec remove visitor pattern
it's overengineered for our purpose and would just get in the way of
planned optimizations.
2010-02-05 15:20:25 +01:00
Oswald Buddenhagen 9c7d803aec don't pre-split RHS of variable assignments
creating tons of items is a tad allocation-intensive and thus slow.

this is probably slower for often-included files, as now the splitting
is done in every evaluation pass.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen 61772da250 omit comments from the "AST"
now that the tree will not be written out any more, we can save some
cpu and memory by not recording the information.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen cc709e963e purge unused "modified" flag from ProFile 2010-01-25 16:53:55 +01:00
hjk 93cbef8724 long live the king 2009-08-14 09:30:56 +02:00