remove pointless double initialization guards
this isn't some fuzzy logic, the call sequence is well determined. Change-Id: I1696b49ed687da83d2969efcfe23ac6565630020 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
12b7b2c643
commit
84c80538af
@ -131,7 +131,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
|
|||||||
|
|
||||||
// ** base makefile generator
|
// ** base makefile generator
|
||||||
MakefileGenerator::MakefileGenerator() :
|
MakefileGenerator::MakefileGenerator() :
|
||||||
init_opath_already(false), init_already(false), no_io(false), project(0)
|
no_io(false), project(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,10 +167,7 @@ MakefileGenerator::verifyCompilers()
|
|||||||
void
|
void
|
||||||
MakefileGenerator::initOutPaths()
|
MakefileGenerator::initOutPaths()
|
||||||
{
|
{
|
||||||
if(init_opath_already)
|
|
||||||
return;
|
|
||||||
verifyCompilers();
|
verifyCompilers();
|
||||||
init_opath_already = true;
|
|
||||||
ProValueMap &v = project->variables();
|
ProValueMap &v = project->variables();
|
||||||
//for shadow builds
|
//for shadow builds
|
||||||
if(!v.contains("QMAKE_ABSOLUTE_SOURCE_PATH")) {
|
if(!v.contains("QMAKE_ABSOLUTE_SOURCE_PATH")) {
|
||||||
@ -413,10 +410,7 @@ void
|
|||||||
MakefileGenerator::init()
|
MakefileGenerator::init()
|
||||||
{
|
{
|
||||||
initOutPaths();
|
initOutPaths();
|
||||||
if(init_already)
|
|
||||||
return;
|
|
||||||
verifyCompilers();
|
verifyCompilers();
|
||||||
init_already = true;
|
|
||||||
|
|
||||||
ProValueMap &v = project->variables();
|
ProValueMap &v = project->variables();
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ struct ReplaceExtraCompilerCacheKey;
|
|||||||
class MakefileGenerator : protected QMakeSourceFileInfo
|
class MakefileGenerator : protected QMakeSourceFileInfo
|
||||||
{
|
{
|
||||||
QString spec;
|
QString spec;
|
||||||
bool init_opath_already, init_already, no_io;
|
bool no_io;
|
||||||
QHash<QString, bool> init_compiler_already;
|
QHash<QString, bool> init_compiler_already;
|
||||||
QString makedir, chkexists;
|
QString makedir, chkexists;
|
||||||
QString build_args(const QString &outdir=QString());
|
QString build_args(const QString &outdir=QString());
|
||||||
|
@ -55,17 +55,14 @@ QString project_builtin_regx() //calculate the builtin regular expression..
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectGenerator::ProjectGenerator() : MakefileGenerator(), init_flag(false)
|
ProjectGenerator::ProjectGenerator() : MakefileGenerator()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ProjectGenerator::init()
|
ProjectGenerator::init()
|
||||||
{
|
{
|
||||||
if(init_flag)
|
|
||||||
return;
|
|
||||||
int file_count = 0;
|
int file_count = 0;
|
||||||
init_flag = true;
|
|
||||||
verifyCompilers();
|
verifyCompilers();
|
||||||
|
|
||||||
project->loadSpec();
|
project->loadSpec();
|
||||||
|
@ -40,7 +40,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class ProjectGenerator : public MakefileGenerator
|
class ProjectGenerator : public MakefileGenerator
|
||||||
{
|
{
|
||||||
bool init_flag;
|
|
||||||
bool addFile(QString);
|
bool addFile(QString);
|
||||||
bool addConfig(const QString &, bool add=true);
|
bool addConfig(const QString &, bool add=true);
|
||||||
QString getWritableVar(const char *, bool fixPath=true);
|
QString getWritableVar(const char *, bool fixPath=true);
|
||||||
|
@ -45,10 +45,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
void
|
void
|
||||||
UnixMakefileGenerator::init()
|
UnixMakefileGenerator::init()
|
||||||
{
|
{
|
||||||
if(init_flag)
|
|
||||||
return;
|
|
||||||
init_flag = true;
|
|
||||||
|
|
||||||
if(project->isEmpty("QMAKE_EXTENSION_SHLIB")) {
|
if(project->isEmpty("QMAKE_EXTENSION_SHLIB")) {
|
||||||
if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) {
|
if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) {
|
||||||
project->values("QMAKE_EXTENSION_SHLIB").append("so");
|
project->values("QMAKE_EXTENSION_SHLIB").append("so");
|
||||||
|
@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class UnixMakefileGenerator : public MakefileGenerator
|
class UnixMakefileGenerator : public MakefileGenerator
|
||||||
{
|
{
|
||||||
bool init_flag, include_deps;
|
bool include_deps;
|
||||||
QString libtoolFileName(bool fixify=true);
|
QString libtoolFileName(bool fixify=true);
|
||||||
void writeLibtoolFile(); // for libtool
|
void writeLibtoolFile(); // for libtool
|
||||||
void writePrlFile(QTextStream &);
|
void writePrlFile(QTextStream &);
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
UnixMakefileGenerator::UnixMakefileGenerator() : MakefileGenerator(), init_flag(false), include_deps(false)
|
UnixMakefileGenerator::UnixMakefileGenerator() : MakefileGenerator(), include_deps(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator(), init_flag(false)
|
MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator()
|
||||||
{
|
{
|
||||||
if (isWindowsShell())
|
if (isWindowsShell())
|
||||||
quote = "\"";
|
quote = "\"";
|
||||||
@ -218,10 +218,6 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
|
|||||||
|
|
||||||
void MingwMakefileGenerator::init()
|
void MingwMakefileGenerator::init()
|
||||||
{
|
{
|
||||||
if(init_flag)
|
|
||||||
return;
|
|
||||||
init_flag = true;
|
|
||||||
|
|
||||||
/* this should probably not be here, but I'm using it to wrap the .t files */
|
/* this should probably not be here, but I'm using it to wrap the .t files */
|
||||||
if(project->first("TEMPLATE") == "app")
|
if(project->first("TEMPLATE") == "app")
|
||||||
project->values("QMAKE_APP_FLAG").append("1");
|
project->values("QMAKE_APP_FLAG").append("1");
|
||||||
|
@ -63,7 +63,6 @@ private:
|
|||||||
|
|
||||||
virtual bool findLibraries();
|
virtual bool findLibraries();
|
||||||
|
|
||||||
bool init_flag;
|
|
||||||
QString objectsLinkLine;
|
QString objectsLinkLine;
|
||||||
QString quote;
|
QString quote;
|
||||||
};
|
};
|
||||||
|
@ -56,7 +56,7 @@ static QString nmakePathList(const QStringList &list)
|
|||||||
.replace('#', QStringLiteral("^#")).replace('$', QStringLiteral("$$"));
|
.replace('#', QStringLiteral("^#")).replace('$', QStringLiteral("$$"));
|
||||||
}
|
}
|
||||||
|
|
||||||
NmakeMakefileGenerator::NmakeMakefileGenerator() : Win32MakefileGenerator(), init_flag(false), usePCH(false)
|
NmakeMakefileGenerator::NmakeMakefileGenerator() : Win32MakefileGenerator(), usePCH(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -335,10 +335,6 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const
|
|||||||
|
|
||||||
void NmakeMakefileGenerator::init()
|
void NmakeMakefileGenerator::init()
|
||||||
{
|
{
|
||||||
if(init_flag)
|
|
||||||
return;
|
|
||||||
init_flag = true;
|
|
||||||
|
|
||||||
/* this should probably not be here, but I'm using it to wrap the .t files */
|
/* this should probably not be here, but I'm using it to wrap the .t files */
|
||||||
if(project->first("TEMPLATE") == "app")
|
if(project->first("TEMPLATE") == "app")
|
||||||
project->values("QMAKE_APP_FLAG").append("1");
|
project->values("QMAKE_APP_FLAG").append("1");
|
||||||
|
@ -40,7 +40,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class NmakeMakefileGenerator : public Win32MakefileGenerator
|
class NmakeMakefileGenerator : public Win32MakefileGenerator
|
||||||
{
|
{
|
||||||
bool init_flag;
|
|
||||||
void writeNmakeParts(QTextStream &);
|
void writeNmakeParts(QTextStream &);
|
||||||
bool writeMakefile(QTextStream &);
|
bool writeMakefile(QTextStream &);
|
||||||
void writeImplicitRulesPart(QTextStream &t);
|
void writeImplicitRulesPart(QTextStream &t);
|
||||||
|
@ -208,7 +208,6 @@ const char _slnExtSections[] = "\n\tGlobalSection(ExtensibilityGlobals) = pos
|
|||||||
|
|
||||||
VcprojGenerator::VcprojGenerator()
|
VcprojGenerator::VcprojGenerator()
|
||||||
: Win32MakefileGenerator(),
|
: Win32MakefileGenerator(),
|
||||||
init_flag(false),
|
|
||||||
is64Bit(false),
|
is64Bit(false),
|
||||||
projectWriter(0)
|
projectWriter(0)
|
||||||
{
|
{
|
||||||
@ -767,9 +766,6 @@ bool VcprojGenerator::hasBuiltinCompiler(const QString &file)
|
|||||||
|
|
||||||
void VcprojGenerator::init()
|
void VcprojGenerator::init()
|
||||||
{
|
{
|
||||||
if (init_flag)
|
|
||||||
return;
|
|
||||||
init_flag = true;
|
|
||||||
is64Bit = (project->first("QMAKE_TARGET.arch") == "x86_64");
|
is64Bit = (project->first("QMAKE_TARGET.arch") == "x86_64");
|
||||||
projectWriter = createProjectWriter();
|
projectWriter = createProjectWriter();
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ class QUuid;
|
|||||||
struct VcsolutionDepend;
|
struct VcsolutionDepend;
|
||||||
class VcprojGenerator : public Win32MakefileGenerator
|
class VcprojGenerator : public Win32MakefileGenerator
|
||||||
{
|
{
|
||||||
bool init_flag;
|
|
||||||
bool is64Bit;
|
bool is64Bit;
|
||||||
bool writeVcprojParts(QTextStream &);
|
bool writeVcprojParts(QTextStream &);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user