Commit Graph

112 Commits

Author SHA1 Message Date
Oswald Buddenhagen
18a515652a drastically cut down qregexp use
this gives a rather impressive speed boost.
if qmake wasn't trying to be so clever, we could get even more
out of this.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
3cdecdd9e1 integrate function argument splitting into expandVariableReferences()
that way we save the creation of a temporary stringlist
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
9b8a09b881 get rid of m_proitem
now that we know the size of the entire file, we can use a single fixed
buffer instead of growing one on-demand - in the case where we just read
the file, we can even re-use the file buffer itself.
this should improve performance for files with very many line
continuations, but the practical impact drowns in the noise.
anyway, the code is nicer, as we don't abuse qstring that obviously any
more.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
cac522b761 read file at once instead of line-wise
again several percent faster ...
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
cc635e2642 avoid QChar::unicode() calls in debug builds
in release mode they expand to nothing ... not so in debug mode.
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
714e981c69 optimize expandVariableReferences()
- nest conditionals properly to avoid unnecessary tests
- avoid usage of QString::append(QChar) to save allocations
2010-01-25 16:53:56 +01:00
Oswald Buddenhagen
48d15b8a66 don't split value list right before expanding variables
the latter will do it anyway.
this eradicates the performance penalty from the previous commit at its
root.
2010-01-25 16:53:56 +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
f9d955eb6c cache parsed pri & prf files
no point in re-parsing them over and over during the scan of a bigger
project ...

shaves off another 20% of the loading time of Qt 4.6.
2009-12-08 17:36:41 +01:00
Oswald Buddenhagen
0682dae77c ProfileEvaluator::Option => ProfileOption
makes forward delcs in headers possible
2009-12-08 17:36:41 +01:00
con
f3bdeb8c9a Share the code for determining used qmake arguments.
Move the code that compares the Qt version's debug|release property
with the build configuration's debug|release property
to the new build configuration class.

Reviewed-by: dt
2009-12-02 18:16:34 +01:00
Oswald Buddenhagen
8b9f29f923 implement eval() 2009-10-02 17:37:20 +02:00
Oswald Buddenhagen
9cb9f29d63 implement infile() and $$fromfile() 2009-09-23 18:19:58 +02:00
Oswald Buddenhagen
2513c0a93f don't attempt to read qmake cache if there is none
evaluating a file (which might not exist) is a bit different than just
merging a (possibly empty) map ...
2009-09-09 10:14:15 +02:00
Oswald Buddenhagen
37c5e2ddd3 revert acd090200 - no crash or even memory corruption reproducible 2009-09-09 02:56:36 +02:00
Oswald Buddenhagen
f1c881c4e0 cache_valuemap doesn't have to be a member any more 2009-09-09 02:56:36 +02:00
dt
acd090200a Fix crash. 2009-09-01 17:27:53 +02:00
dt
dad4aa05b7 Remove now dead code. 2009-09-01 16:13:56 +02:00
dt
f4c10deeb3 Fix parsing of .qmake.cache Fixes DESTDIR for debug_and_release_targets
Closer again to qmake, ossi won't like it, but this is exactly what
qmake does, even it it looks a little bit strange. He can come up with
a better fix after he is back from vacation.
2009-09-01 15:59:12 +02:00
Oswald Buddenhagen
002cc5b517 fix function argument evaluation
i think it is finally identical to qmake (i.e., equally braindamaged)
2009-08-14 17:38:13 +02:00
Oswald Buddenhagen
e13a55ce52 don't skip unconditional scopes 2009-08-14 17:38:13 +02:00
Oswald Buddenhagen
695ac13cdc remove some superfluous braces 2009-08-14 11:48:05 +02:00
Oswald Buddenhagen
3a24a6992b fix message reporting in derived classes
{log,error,file}Message() cannot contain logic which makes the output
conditional on private evaluator state, as they are virtual and thus
derived classes could receive messages which they are not supposed to
receive. so put the logic into likewise named functions in the private
class and call these throughout.
2009-08-14 11:48:05 +02:00
Oswald Buddenhagen
f1f2d0cd88 remove forgotten enum 2009-08-14 11:45:49 +02:00
Oswald Buddenhagen
7f50d949a9 fix line continuation parsing ... again 2009-08-14 11:45:49 +02:00
hjk
93cbef8724 long live the king 2009-08-14 09:30:56 +02:00
Keith Isdale
c2a1d75daa qmake's include function now supports three arguments
The second and third arguments to qmake's include function are
optional

Task-number: 259398
Reviewed-by: Stian Sandvik Thomassen
2009-08-14 15:41:26 +10:00
Oswald Buddenhagen
94c4ea83bc inherit functions from the base config
the base config is read with a separate reader. we saved its variables,
but not its custom function definitions.
2009-08-11 20:37:24 +02:00
Oswald Buddenhagen
8e726a6d58 next attempt at fixing low-level parsing
in particular, fix line continuation processing.

also, reintroduce some error handling. it checks only one condition so
far (malformed assignment statement) and is entirely silent, but that's
all that was necessary for internal robustness.
2009-08-11 20:37:24 +02:00
Oswald Buddenhagen
9efc9ce0e4 make $$_QMAKE_CACHE_ return something useful now that we support it 2009-08-11 20:37:23 +02:00
Oswald Buddenhagen
1b0fbbffad don't hang in .qmake.cache search when build dir does not exist
QDir::cdUp() is strange ...
2009-08-05 12:38:02 +02:00
Oswald Buddenhagen
b972177444 don't report prf inclusions to derived classes 2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
81f6001f91 move include recursion check to evaluateFile() where it belongs 2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
f4cc46d5de move qmake property hash to option object
that way they are auto-inherited by nested parsers, and it's the right
thing to do anyway.
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
f50952f17a complain about querying non-existing properties
... except where it is expected
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
a89bee6dab rely on the properties passed into the evaluator
fallbacks to values from the qt we were compiled/linked against really
make no sense.
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
f6f8340b8e improved high-level qmake compat
- parse .qmake.cache, remove workaround for not doing it
- look for the mkspecs in all the places qmake would do
- use the passed in properties instead of QLibraryInfo to find the qt
  data dir
- fix loading of generic features from within os-specific ones with the
  same name
- add multiple inclusion guard for features (including what seems to be
  a bug in qmake ...)
- misc cleanups and beautifications
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
dfcf9889a7 look only for mkspec features for the current target platform 2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
6b85d482b6 micro-optimizations 2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
bcda15ee97 fixEnvVariables => expandEnvVars overload 2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
0d0860a0be set the current work dir even for pri files
qmake does so.
of course, in the longer run we need to get rid of this at all, but this
would require quite some reviewing of side effects.
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
980868cee4 make the qmake option object a proper member
to be able to share the option object among evaluators, it is passed by
pointer.

only field_sep stays static and becomes a string - that's effectively
just a cache to avoid repeated construction.
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
3739af6c46 make Option a nested class of ProFileEvaluator
it's still static at that point, though.
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
c699522bf9 shuffle code around
non-inline implementations in a header? feh!
2009-08-04 20:59:28 +02:00
Oswald Buddenhagen
3399e362cc inline trivial functions 2009-08-04 20:59:27 +02:00
Oswald Buddenhagen
9431850fcd remove remainders of a fairly useless set of asserts
(the rest seems to have evaporated over time or never existed in the
first place)
2009-08-04 20:59:27 +02:00
Oswald Buddenhagen
5b7c8848e5 don't push top level pro file twice on stack 2009-08-04 20:59:27 +02:00
Oswald Buddenhagen
023affc603 get rid of m_origfile
it's redundand
2009-08-04 20:59:27 +02:00
Oswald Buddenhagen
36bbb3bc0e initialize TARGET properly instead of fixing it later
... which is also what qmake does
2009-08-04 20:59:27 +02:00