Commit Graph

232 Commits

Author SHA1 Message Date
Bill King
55edbe1c5b Fix parameters hidden by local variables. 2010-06-11 13:35:22 +10:00
Oswald Buddenhagen
0732fd03aa minor optimization: use QString::setRawData some more 2010-06-10 17:14:54 +02:00
con
b0040dc858 Merge remote branch 'origin/2.0'
Conflicts:
	src/plugins/projectexplorer/taskwindow.cpp
	src/shared/proparser/profileevaluator.cpp
2010-06-10 15:00:16 +02:00
Oswald Buddenhagen
1dc99e8ff3 try to sort out the filename encoding mess
use local8bit instead of latin1 resp. 8bit-passthrough, after all.

the situation was as follows:
- if the pro files and file names were all ascii, everything just worked
- if either contained non-ascii:
  - on unix, the evaluator would work as long as the file content
    encoding matched the file name encoding, and the ui would work as
    long as the file name encoding was latin1 (i.e., on no modern
    system)
  - on windows, both would work only if the ansi code page was
    latin1/cp1252 (i.e., on western systems)

i.e., even in the low-level evaluator, only native latin1 systems with
actual latin1 files worked consistently. given this situation, it makes
little sense to make an encoding adapter between the evaluator and the
ui as originally planned. instead, take the easy way out and use
local8bit - this continues to work for native latin1 systems+files in
the backend, and makes the ui work for everything the backend groks and
some more.

Reviewed-by: dt
Task-number: QTCREATORBUG-930
2010-06-09 11:46:10 +02:00
Oswald Buddenhagen
fc421df12d micro-optimizations 2010-06-09 11:46:10 +02:00
Oswald Buddenhagen
f8959aa759 hide includes from within feature files
this fixes the recent appearance of qt_webkit_version.pri in all qt 4.7
based projects.

in fact, the patch does somewhat more: it makes the evaluator provide
the information to the higher layers which is necessary for a truly
hierarchical display of includes. TBD later.

Reviewed-by: dt
Task-number: QTCREATORBUG-1590
2010-06-08 11:09:42 +02:00
con
7f733b1545 Merge remote branch 'origin/2.0'
Conflicts:
	README
	doc/qt-html-templates.qdocconf
	doc/qtcreator.qdoc
	doc/qtcreator.qdocconf
	src/app/Info.plist
	src/plugins/bineditor/BinEditor.pluginspec
	src/plugins/bookmarks/Bookmarks.pluginspec
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec
	src/plugins/coreplugin/Core.pluginspec
	src/plugins/coreplugin/coreconstants.h
	src/plugins/cpaster/CodePaster.pluginspec
	src/plugins/cppeditor/CppEditor.pluginspec
	src/plugins/cpptools/CppTools.pluginspec
	src/plugins/cvs/CVS.pluginspec
	src/plugins/debugger/Debugger.pluginspec
	src/plugins/designer/Designer.pluginspec
	src/plugins/fakevim/FakeVim.pluginspec
	src/plugins/find/Find.pluginspec
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec
	src/plugins/git/ScmGit.pluginspec
	src/plugins/helloworld/HelloWorld.pluginspec
	src/plugins/help/Help.pluginspec
	src/plugins/locator/Locator.pluginspec
	src/plugins/mercurial/Mercurial.pluginspec
	src/plugins/perforce/Perforce.pluginspec
	src/plugins/projectexplorer/ProjectExplorer.pluginspec
	src/plugins/qmldesigner/QmlDesigner.pluginspec
	src/plugins/qmlinspector/QmlInspector.pluginspec
	src/plugins/qmljseditor/QmlJSEditor.pluginspec
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec
	src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec
	src/plugins/regexp/RegExp.pluginspec
	src/plugins/resourceeditor/ResourceEditor.pluginspec
	src/plugins/snippets/Snippets.pluginspec
	src/plugins/subversion/Subversion.pluginspec
	src/plugins/texteditor/TextEditor.pluginspec
	src/plugins/vcsbase/VCSBase.pluginspec
	src/plugins/welcome/Welcome.pluginspec
2010-06-08 10:39:45 +02:00
Oswald Buddenhagen
aa61af1493 make the evaluator (even more) thread-safe
the async re-parsing code breaks the assumption that project
parsing only ever starts with a single non-concurrent evaluation
(of the top-level project file), so the population of the base
values in the shared ProFileOption was happily causing crashes.

Reviewed-by: dt
Task-number: QTCREATORBUG-1569
2010-06-04 17:57:04 +02:00
Robert Loehning
356648b7f4 Compile fix.
Reviewed-by: Oswald Buddenhagen
2010-06-02 21:51:27 +02:00
Oswald Buddenhagen
033a148b43 optimize assignments: record number of literals
that way the result vector can be pre-allocated - which gives zero
resizes if no expansions are in the expression.
for the joined argument lists of built-in functions, pre-allocate a
fixed 5 elements, which covers all cases and more.
the argument lists of user-defined functions are not pre-allocated
yet.
2010-06-02 11:05:27 +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
932d77b6dd qmake compat: delete empty elements when assigning values
some replace functions can return empty elements which should be
zapped here (according to qmake, anyway).
2010-06-02 11:05:27 +02:00
Oswald Buddenhagen
c982d275ed factor out evaluateBoolFunction() 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
dad37b23d8 maintain m_lineNo better during evaluation 2010-06-02 11:05:27 +02:00
Oswald Buddenhagen
b97b53d9bf generalize ALWAYS_INLINE somewhat 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
2fd83af82f optimize assembly of arguments for built-in functions
this function class just joins each string list argument into a
single string. so instead of first building a list and joining it
right afterwards, create a single string in the first place.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
25e6890c93 an empty argument list is still a list with one empty argument
that's actually kinda braindead, but that's qmake as usual.
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
d47b00fca8 implement $$size() 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
a98ce55e7b simplify $$quote() implementation 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
95d5ad4ab3 unify parsing of boolean arguments 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
33c5befc7f use QList::contains() instead of iterating 2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
a0cc2aec74 complain about unclosed scopes 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
583d688ee4 make if() evaluation more qmake-like
... which basically means "break it".
2010-06-02 11:05:26 +02:00
Oswald Buddenhagen
a292fb1d77 interpret '!' operator only at start of token 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
295e07eadc short-cut evaluation inside if() tests
this is consistent with the top-level scope evaluation.
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
40ffa44b74 inline doVariableReplace()
it's pretty trivial and not used a lot
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
e75092455c eliminate special splitting of INCLUDEPATH and DEPENDPATH
it wouldn't work as expected anyway, as the splitting rule (using the
semicolon in addition to whitespace) applied only to the string literal
from the pro file, but not any expanded [environment] variables, etc.
(i.e., where it might any make sense). so just drop it, as it would
considerably complicate following optimizations.
2010-06-02 11:05:25 +02:00
Oswald Buddenhagen
f269f86982 don't double-expand for() arguments
unlike in qmake, the arguments are already expanded at this point
(which is strictly speaking a bug for the iterator variable name),
so it is plain wrong to call doVariableReplace on them.
2010-04-20 12:02:10 +02:00
Oswald Buddenhagen
2af6e73c59 avoid detaching
amazingly enough, qlist::{first,last}() have non-const versions,
which are of course used when you least expect it ...
2010-04-20 12:02:10 +02:00
Oswald Buddenhagen
f26019bed8 fix location info in parsing-error messages 2010-04-20 12:02:10 +02:00
dt
9663067357 Fix deadlock in .pro file evaluation.
We used to indicate that the cache for a file is up to date by having a
Entry with ent->locker == 0. But we first wake up all threads and only
after all the threads who waited for that parse to complete we set
ent->locker to zero. Thus a different thread could get the impression
that it needs to wait for the parse thread, yet get no wake up.

We need a different flag to indicate that we are actually already done
parsing and the cache can simply be used instead of waiting for a wake
up.

Reviewed-By: ossi
2010-03-17 16:27:50 +01: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
66780cf198 cache failed parses as well 2010-02-26 13:09:20 +01:00
Oswald Buddenhagen
8bb90d47bd fix include() parseInto implementation
the "namespace" created by the prefix is supposed to be cleared before
new values are added.
2010-02-15 17:14:25 +01:00
Oswald Buddenhagen
1d39b04041 add legacy variable name mapping
we are so fast now, we can burn a few cycles again ... :}

variable names are mapped as soon as they become known (and not when
using them). that sprinkles map() calls everywhere, but it's faster.
2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
6060bb5b9e cut down code dupe in count() impl 2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
081f27e3ea process second arg of include() 2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
07abc847e8 expand $()-style env vars in some more places like qmake does
Task-number: QTCREATORBUG-229
2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
35bc0f3609 simplify exists() implementation 2010-02-12 14:32:20 +01:00
Oswald Buddenhagen
5d0f65fc91 don't assert on $$files(/foo) 2010-02-10 16:20:41 +01:00
Oswald Buddenhagen
caedef35e2 fix conditionals on the qmakespec
- match just the spec name without a possible path
- resolve the default spec
2010-02-10 15:40:53 +01:00
Oswald Buddenhagen
e0e4c4d3bf properly evaluate one-arg-variant of CONFIG() 2010-02-10 15:40:53 +01:00
Oswald Buddenhagen
46bc5a80ac make $$files() qmake-compliant again
unfortunately, the efforts to use only absolute paths internally became
externally visible ...
2010-02-10 15:40:53 +01:00
Oswald Buddenhagen
0e6fe766dd optimize function scoping
previously, the entire value hash was simply pushed on a stack upon
entering a custom function. the problem with that was that setting the
function's argument already detached (i.e., copied) the entire hash.
so instead store only actually modified values in nested scopes and let
lookups cascade to parent scopes.

improvement: 2% for qt, 15% for creator ...
2010-02-09 20:48:34 +01:00