the replacement value may well constitute the whole output string - this
is in fact common, given this rather typical usage pattern:
BAR = $$replace(FOO, -flag, -otherflag)
this must be considered when constructing the return value.
compare 3c8134958c.
as of now, this is irrelevant, as QString::replace(QRegExp, QString) will
always memcpy the replacement into a detached copy of the target, but one
never knows.
Change-Id: Ia1f271f45023746040fc28ce6d88a6609e05e5c2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
technically, we should not rely on the i/o classes not storing the
strings beyond the instantiated object's life time.
Change-Id: I0990769b3cf86860184869036c096c531160e9be
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
property values are de-facto guaranteed to be backed by full QStrings,
so there is nothing to be gained from using the raw data optimization,
while doing so risks raw data leaks.
Change-Id: I3d43da9aaadd4d5811c4b1a9d7ac734049da423c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
it's not clear why detaching would be necessary; there is no danger of a
raw data leak here.
concatenating a QStringRef with a non-empty QLatin1String (the only
expected use of this overload) will yield a detached QString anyway, so
this makes little difference in practice.
amends f137957e08.
Change-Id: I521c0e89a8b0c1ae62b1450e81b0ae91a931bcfa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
no m_tmp is involved any more in this code path; it uses QStringRef.
amends 11d957d043.
Change-Id: Ib272d61edfb150a549c5e6a9a60d53502702e802
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
the m_tmp array is a member, so the index toggle for accessing it also
needs to be one - otherwise, odd iteration counts will defeat the
mechanism.
Change-Id: If7a800ed5a4b4168625daf1ebbd5d2d164569d8e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
... in $$basename(), $$dirname(), and contains(). the latter case is
marginal, as it only applies to mutuals which are regexes, which i don't
remember ever seeing used.
QRegExp saves a copy of the matched string, so it's necessary to
alternate between two temporaries to avoid detaching. we already
did that in most places.
Change-Id: I97b8294585c17c76d1756f83971f42cb88353af0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
in most cases, the main advantage is not using toQString(m_tmp), which
reduces the possibility of raw data leaks. in cases where we used
toQString() without temporary, this is a slight optimization.
Change-Id: Ib343acffd383aa2c4fefab75fb52762fb534dfc6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The strings remember in which file they were created/assigned.
However, this used a non-counting reference to a ProFile, which could
become dangling. If a subsequent ProFile re-used the exact same address,
a string's source would be mis-identified, which would be fatal in
conjunction with discard_from().
Since we actually need only a unique id for comparison, let's use an
integer for that.
Task-number: QTBUG-62434
Started-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Similar to the two parent commits, this patchs preserves the time stamps
of files we install as a result of recursive directory copying.
Change-Id: Id5931a467196d5cd67acfa0deffc2488af8a3669
Task-number: QTBUG-59004
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
On non-windows platforms, we use the "-p" parameter of install(1) to
preserve the last modification timestamps of files. On Windows the use
of copy does not preserve them. As a cross-platform solution, this patch
introduces a simple built-in install command in qmake to copy files.
Task-number: QTBUG-59004
Change-Id: I3064d29a2b8c7b009a1efbf8f00b84c079ea5417
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The code in question is obviously checking for support of QProcess, not
for general bootstrap mode. You can manually disable QProcess, in which
case it is still not available after bootstrapping is done.
Change-Id: Ia99810b8900621911a31912034358a01af4f18a0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
On POSIX compliant platforms, the default precision we apply to
preserving time stamps is seconds. However we can do better and use
utimensat() - if available - to increase the precision to nanoseconds.
The values are provided by statbuf's st_mtim. This is guarded for
compatibility with older systems, similar to commit
494ced1329.
Change-Id: I6928660230d84f8511bf0f58e268906d2e575e04
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
in particular, -before (just for symmetry, as it's the default), -early
(the actual objective), and -late (for symmetry again).
Change-Id: I274303582a348b052c3e5106ff360ab4fd7d4ee2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
the arguments after '--' are by definition meant only for the top-level
project, as that's where configure is invoked from. passing them to
sub-projects just adds noise to the make output and misleads users.
note that this specifically does not support qmake -r, which will break
if the subprojects rely on the arguments being absent. this isn't a
problem, because the qt build doesn't support qmake -r anyway.
Change-Id: I7ecff6212ce3137526005fc324a4a7ae45e3345e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Most of these involved moving or removing extraneous
aide-memoir comments left by programmers between qdoc
comments and their functions. There were also some
cases where Q_CLANG_QDOC had to be tested to make
something visible to clangqdoc. And there were a few
functions that should not have been documented at all.
Change-Id: I3bf7c397a9e5ddbffc40cc1fee7f19cad71a1ae7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
there is no point in iterating BAR if FOO is (or became) empty.
Change-Id: I86c89bf0ad726a5ab7ead990a27ef7cc32caebbf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
this is of marginal value, as only our own code ever messes with
QMAKESPEC, and we mostly stopped matching on the spec in favor of
compiler and platform flags.
Change-Id: Ibdd9a9c85067623f0f1f064d139d23b4e6b0677d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
since ab0cc305, the spec will be replaced by an entirely new one during
configuration, and so needs to update the path separator for
$$shell_{path,quote}(). however, the latter didn't happen, as the spec
reloading doesn't go through the "real" spec loading path.
Change-Id: I45ab3156b8e040f683328ac46e48b09c2eb94ef7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
this moves us another step towards the "outer" configure doing just
minimal bootstrapping of qmake.
a challenge here was that so far, qmake itself needed qconfig.cpp. this
was replaced by usage of a qt.conf file instead of compiled-in values.
however, to make the executable still self-contained, that qt.conf is
embedded into it (by simple appending of a fixed signature and the text
file).
the qmake with the embedded qt.conf is not used for the qt build itself,
which instead relies on the qt.conf in bin/ as before. however, due to
the missing built-in values, this file now needs to contain more
information than before. but except for a minimal version that is needed
to start up qmake/configure at all, that file is now also generated with
qmake. as some of the newly set up properties are subsequently used by
configure itself, qmake gains a (deliberately undocumented) function to
reload the qt.conf after it's fully populated.
unlike the old implementations, this one doesn't emit redundant qt.conf
entries which match the hard-coded fallbacks. omitting them leads to
leaner files which are more comprehensible.
Started-by: Paolo Angelelli <paolo.angelelli@qt.io>
Change-Id: I4526ef64b3c89d9851e10f83965fe479ed7f39f6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
otherwise, infinite loops can result, as amply demonstrated by the new
configure (which duly replicated the old configures' behavior ...).
QMakeEvaluator::evaluateBuiltinExpand() now returns a VisitReturn like
all other evaluate*() functions. the string list return value is now an
out parameter; i used a reference instead of a pointer to avoid
adjusting 56 usages of it.
Task-number: QTBUG-13964
Change-Id: I51ca7df8d694c6ffe9d9899cba414b1b46f5ce95
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
when the file's effects are discarded, the mention of the file should be
as well.
Change-Id: I894b7e2b887dd34d18533b197bfa9d0d84d647e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
the normal mode forces the prompt into a pattern which may be
undesirable.
Change-Id: I01689c7a6573415801862348b32bafc6a609ed4a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We can not improve the result from JSON parsing without changing API,
so instead recalculate the line and column based on input and offset.
Change-Id: I54149233f71023aa5d30deff854d6f3406c5c48c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
the autotest was also broken, because it was created by pasting the
bogus message into the result ...
Change-Id: I02b8663b96c7d96cdb3c19639e2213e49fd2bcec
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
necessary for use outside qmake itself.
amends f137957e08.
Change-Id: Ie069f7b6efc969ab112e1f0ecd966eb06248fb94
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
so far, we "downgraded" only explicit error() output, but other errors
may happen as well while doing semi-exact evaluation of .prf files - at
least hypothetically.
amends 08d0cb6f8e.
Change-Id: I32819a569dbed2dbdb37c5c23bf4a5a18d3c64ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
(cherry picked from qttools/ea1a5c3534f089c0e704808a0fb029eda8f753b4)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
this function discards all values that come from a specific file. it
will be needed for configure bootstrapping, but is too obscure to
document it for general use.
Change-Id: I62c18aeb1847712e33d0599dbb0b90ffa1722438
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
this goes at the cost of <into> without the subsequent dot not being
filtered before the result insertion any more. that's not expected to
be a problem, as it's not particularly useful to iterate the target
namespace without the dot in the first place.
Change-Id: Ib3497a60613b4c8c26676fe76b731239e427b8a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
we have all necessary overloads now.
Change-Id: Ic4472eba15d4234e968fcb9443d0f79011aa43fd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replaces our mix of comments for annotating intended absence of break
in switches with the C++17 attribute [[fallthrough]], or its earlier
a clang extension counterpart.
Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>