diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-02-04 17:12:03 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-02-04 15:10:49 +0000 |
commit | 4748acbf1e2afab8bebaf1ed6727b9cd01861731 (patch) | |
tree | 4912751800a335a281578721cbea71501369bea7 /qmake/generators/unix | |
parent | 4a251da5bb79da00a2e720d136952114c816dd1e (diff) |
qmake: use QString::replace() overloaded with QLatin1String
instead of QStringLiteral, QString, const char*.
Results: reduce .rodata, prevent re-creation of QString.
Change-Id: Ie2e3089974c42e6733457bbe58521bccd1da3a53
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake/generators/unix')
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 8 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 12b9f09edd..5c6db3364e 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -178,12 +178,12 @@ UnixMakefileGenerator::init() pchBaseName += project->first("QMAKE_ORIG_TARGET").toQString(); // replace place holders - pchFlags.replace("${QMAKE_PCH_INPUT}", + pchFlags.replace(QLatin1String("${QMAKE_PCH_INPUT}"), escapeFilePath(project->first("PRECOMPILED_HEADER").toQString())); - pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName)); + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_BASE}"), escapeFilePath(pchBaseName)); if (project->isActiveConfig("icc_pch_style")) { // icc style - pchFlags.replace("${QMAKE_PCH_OUTPUT}", + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT"))); } else { // gcc style (including clang_pch_style) @@ -197,7 +197,7 @@ UnixMakefileGenerator::init() ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler)); if (!language.isEmpty()) { - pchFlags.replace("${QMAKE_PCH_OUTPUT}", + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchBaseName + language + headerSuffix)); } } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 9db64bebee..848e47f696 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -536,7 +536,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl; //communicated below ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD"); - cmd[0] = cmd.at(0).toQString().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick + cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick cmd.append(incr_target_dir_f); deps.prepend(incr_target_dir_d + ' '); incr_deps = "$(INCREMENTAL_OBJECTS)"; @@ -704,7 +704,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t"; ar = project->first("QMAKE_AR_CMD").toQString(); - ar.replace("$(OBJECTS)", escapeFilePaths(build).join(' ')); + ar.replace(QLatin1String("$(OBJECTS)"), escapeFilePaths(build).join(' ')); } else { t << destdir_d << escapeDependencyPath(*libit) << ": " << valList(escapeDependencyPaths(build)) << "\n\t"; @@ -1083,8 +1083,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f << "\n\trm -f " << escapeFilePath(pchOutput); - pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile_f) - .replace("${QMAKE_PCH_TEMP_OBJECT}", escapeFilePath(objectFile)); + pchFlags.replace(QLatin1String("${QMAKE_PCH_TEMP_SOURCE}"), sourceFile_f) + .replace(QLatin1String("${QMAKE_PCH_TEMP_OBJECT}"), escapeFilePath(objectFile)); } else { // gcc style (including clang_pch_style) ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX"); @@ -1103,9 +1103,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(pchOutputDir); } - pchFlags.replace("${QMAKE_PCH_INPUT}", escapeFilePath(pchInput)) - .replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName.toQString())) - .replace("${QMAKE_PCH_OUTPUT}", escapeFilePath(pchOutput.toQString())); + pchFlags.replace(QLatin1String("${QMAKE_PCH_INPUT}"), escapeFilePath(pchInput)) + .replace(QLatin1String("${QMAKE_PCH_OUTPUT_BASE}"), escapeFilePath(pchBaseName.toQString())) + .replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchOutput.toQString())); QString compilerExecutable; if (compiler == "C" || compiler == "OBJC") @@ -1151,7 +1151,7 @@ void UnixMakefileGenerator::init2() ProStringList &ar_cmd = project->values("QMAKE_AR_CMD"); if (!ar_cmd.isEmpty()) - ar_cmd[0] = ar_cmd.at(0).toQString().replace("(TARGET)","(TARGETA)"); + ar_cmd[0] = ar_cmd.at(0).toQString().replace(QLatin1String("(TARGET)"), QLatin1String("(TARGETA)")); else ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)"); if (!project->isEmpty("QMAKE_BUNDLE")) { |