diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-05-13 15:32:50 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-05-24 12:38:59 +0000 |
commit | ad17a35853fe21a93fc34f7b2d9262c5ac992b29 (patch) | |
tree | 668279d86081849c0cfd01933ebf687694d93f46 /qmake/library/qmakeevaluator.cpp | |
parent | 11d957d04381c7162dd5621c61f9963580ec7041 (diff) |
make QMakeParser take a QStringRef as input
the only place where this actually saves a deep copy is the evaluation
of if(), but as a side effect the parser is now able to deal with not
null-terminated strings, which is kinda nice as well.
Change-Id: Ib6d08617aa79d2f9eaecd4906d4d548f34bf377d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake/library/qmakeevaluator.cpp')
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 4ce7b0c4b8..6182e4bf3e 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1277,7 +1277,7 @@ void QMakeEvaluator::setupProject() void QMakeEvaluator::evaluateCommand(const QString &cmds, const QString &where) { if (!cmds.isEmpty()) { - ProFile *pro = m_parser->parsedProBlock(cmds, where, -1); + ProFile *pro = m_parser->parsedProBlock(QStringRef(&cmds), where, -1); if (pro->isOk()) { m_locationStack.push(m_current); visitProBlock(pro, pro->tokPtr()); @@ -1760,7 +1760,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction( return ProStringList(); } -bool QMakeEvaluator::evaluateConditional(const QString &cond, const QString &where, int line) +bool QMakeEvaluator::evaluateConditional(const QStringRef &cond, const QString &where, int line) { bool ret = false; ProFile *pro = m_parser->parsedProBlock(cond, where, line, QMakeParser::TestGrammar); @@ -1778,7 +1778,7 @@ void QMakeEvaluator::checkRequirements(const ProStringList &deps) { ProStringList &failed = valuesRef(ProKey("QMAKE_FAILED_REQUIREMENTS")); for (const ProString &dep : deps) - if (!evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line)) + if (!evaluateConditional(dep.toQStringRef(), m_current.pro->fileName(), m_current.line)) failed << dep; } #endif |