Author: hpoussin
Date: Fri Mar 7 09:16:26 2008
New Revision: 32593
URL:
http://svn.reactos.org/svn/reactos?rev=3D32593&view=3Drev
Log:
Prevent some FileLocation copies (in LinkerScript and PchFile classes)
Modified:
trunk/reactos/tools/rbuild/automaticdependency.cpp
trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
trunk/reactos/tools/rbuild/linkerscript.cpp
trunk/reactos/tools/rbuild/module.cpp
trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/automaticdependency.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/automati=
cdependency.cpp?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/automaticdependency.cpp (original)
+++ trunk/reactos/tools/rbuild/automaticdependency.cpp Fri Mar 7 09:16:26 =
2008
@@ -301,7 +301,7 @@
=
if ( module.pch !=3D NULL )
{
- const FileLocation& pch =3D module.pch->file;
+ const FileLocation& pch =3D *module.pch->file;
File *file =3D new File ( pch.directory, pch.relative_path, pch.name , f=
alse, "", true );
files.push_back ( file );
}
Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/=
codeblocks/codeblocks.cpp?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Fri Mar 7=
09:16:26 2008
@@ -399,7 +399,7 @@
if ( module.pch !=3D NULL )
{
string pch_path =3D Path::RelativeFromDirectory (
- module.pch->file.name,
+ module.pch->file->name,
module.output->relative_path );
=
header_files.push_back ( pch_path );
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/=
mingw/modulehandler.cpp?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Fri Mar 7 0=
9:16:26 2008
@@ -1236,8 +1236,8 @@
if ( !module.pch || !use_pch )
return NULL;
return new FileLocation ( IntermediateDirectory,
- module.pch->file.relative_path,
- ReplaceExtension ( module.pch->file.name, "_" +=
module.name + ".gch" ) );
+ module.pch->file->relative_path,
+ ReplaceExtension ( module.pch->file->name, "_"
=
+ module.name + ".gch" ) );
}
=
Rule arRule1 ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noex=
t).a: $($(module_name)_OBJS) | $(INTERMEDIATE)$(SEP)$(source_dir)\n",
@@ -1649,7 +1649,7 @@
=
string linkerScriptArgument;
if ( module.linkerScript !=3D NULL )
- linkerScriptArgument =3D ssprintf ( " -Wl,-T,%s", backend->GetFullName (=
module.linkerScript->file ).c_str () );
+ linkerScriptArgument =3D ssprintf ( " -Wl,-T,%s", backend->GetFullName (=
*module.linkerScript->file ).c_str () );
else
linkerScriptArgument =3D "";
=
@@ -1807,7 +1807,7 @@
string cc =3D ( module.host =3D=3D HostTrue ? "${host_gcc}" :
"${gcc}" );
string cppc =3D ( module.host =3D=3D HostTrue ? "${host_gpp}" :
"${gpp}"=
);
=
- const FileLocation& baseHeaderFile =3D module.pch->file;
+ const FileLocation& baseHeaderFile =3D *module.pch->file;
CLEAN_FILE ( *pchFilename );
string dependencies =3D backend->GetFullName ( baseHeaderFile );
/* WIDL generated headers may be used */
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/=
msvc/vcprojmaker.cpp?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Fri Mar 7 09:1=
6:26 2008
@@ -427,7 +427,7 @@
{
fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=3D\"2\"\r\n" );
string pch_path =3D Path::RelativeFromDirectory (
- module.pch->file.name,
+ module.pch->file->name,
module.output->relative_path );
string::size_type pos =3D pch_path.find_last_of ("/");
if ( pos !=3D string::npos )
Modified: trunk/reactos/tools/rbuild/linkerscript.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/linkersc=
ript.cpp?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/linkerscript.cpp (original)
+++ trunk/reactos/tools/rbuild/linkerscript.cpp Fri Mar 7 09:16:26 2008
@@ -22,13 +22,14 @@
=
LinkerScript::LinkerScript ( const XMLElement& node_,
const Module& module_,
- const FileLocation& file_ )
+ const FileLocation *file_ )
: node(node_), module(module_), file(file_)
{
}
=
LinkerScript::~LinkerScript ()
{
+ delete file;
}
=
void
Modified: trunk/reactos/tools/rbuild/module.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.c=
pp?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/module.cpp (original)
+++ trunk/reactos/tools/rbuild/module.cpp Fri Mar 7 09:16:26 2008
@@ -779,14 +779,14 @@
if ( pos =3D=3D string::npos )
{
linkerScript =3D new LinkerScript (
- e, *this, FileLocation ( SourceDirectory, relative_path, e.value, &e )=
);
+ e, *this, new FileLocation ( SourceDirectory, relative_path, e.value, =
&e ) );
}
else
{
string dir =3D e.value.substr ( 0, pos );
string name =3D e.value.substr ( pos + 1);
linkerScript =3D new LinkerScript (
- e, *this, FileLocation ( SourceDirectory, relative_path + sSep + dir, =
name, &e ) );
+ e, *this, new FileLocation ( SourceDirectory, relative_path + sSep + d=
ir, name, &e ) );
}
subs_invalid =3D true;
}
@@ -824,14 +824,14 @@
if ( pos =3D=3D string::npos )
{
pch =3D new PchFile (
- e, *this, FileLocation ( SourceDirectory, relative_path, e.value, &e )=
);
+ e, *this, new FileLocation ( SourceDirectory, relative_path, e.value, =
&e ) );
}
else
{
string dir =3D e.value.substr ( 0, pos );
string name =3D e.value.substr ( pos + 1);
pch =3D new PchFile (
- e, *this, FileLocation ( SourceDirectory, relative_path + sSep + dir, =
name, &e ) );
+ e, *this, new FileLocation ( SourceDirectory, relative_path + sSep + d=
ir, name, &e ) );
}
subs_invalid =3D true;
}
@@ -1704,9 +1704,14 @@
PchFile::PchFile (
const XMLElement& node_,
const Module& module_,
- const FileLocation& file_ )
+ const FileLocation *file_ )
: node(node_), module(module_), file(file_)
{
+}
+
+PchFile::~PchFile()
+{
+ delete file;
}
=
void
Modified: trunk/reactos/tools/rbuild/rbuild.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h=
?rev=3D32593&r1=3D32592&r2=3D32593&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/tools/rbuild/rbuild.h (original)
+++ trunk/reactos/tools/rbuild/rbuild.h Fri Mar 7 09:16:26 2008
@@ -639,11 +639,11 @@
public:
const XMLElement& node;
const Module& module;
- FileLocation file;
+ const FileLocation *file;
=
LinkerScript ( const XMLElement& node,
const Module& module,
- const FileLocation& file );
+ const FileLocation *file );
~LinkerScript ();
void ProcessXML();
};
@@ -843,12 +843,13 @@
public:
const XMLElement& node;
const Module& module;
- FileLocation file;
+ const FileLocation *file;
=
PchFile (
const XMLElement& node,
const Module& module,
- const FileLocation& file );
+ const FileLocation *file );
+ ~PchFile();
void ProcessXML();
};
=