Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20682
Modified Files:
Compiler.cpp Compiler.h
Log Message:
A compiler can be (automatically) associated to a benchmark.
Index: Compiler.h
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Compiler.h 6 Feb 2007 19:42:18 -0000 1.3
--- Compiler.h 15 Feb 2007 18:58:05 -0000 1.4
***************
*** 12,15 ****
--- 12,28 ----
#include <string>
+ #ifdef SWIG
+ /* !!! If in SWIG parser, we need to define CBM::Plan so that all methods get
+ * correctly wrapped. Hope there's a better solution... */
+ %module CBM
+ %{
+ #include <Plan/Plan.h>
+ %}
+ #define CBM_PLAN CBM::Plan
+
+ #else
+ # define CBM_PLAN class Plan
+ #endif
+
namespace CBM {
// class CBM::System;
***************
*** 37,40 ****
--- 50,55 ----
class System *system;
+ CBM_PLAN *plan;
+
/** Initialised by constructor.
\sa Compiler()
***************
*** 58,61 ****
--- 73,78 ----
virtual std::string getCompilerVersion(void) = 0;
public:
+ virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject);
+
/** Internal compiler id.
\return std::string like 'gcc' or 'g++'.
Index: Compiler.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Compiler.cpp 6 Feb 2007 19:25:27 -0000 1.2
--- Compiler.cpp 15 Feb 2007 18:58:05 -0000 1.3
***************
*** 10,13 ****
--- 10,14 ----
#include <Compiler/Compiler-GCC/Compiler-GCC.h>
#include <Compiler/Compiler-TCC/Compiler-TCC.h>
+ #include <Plan/Plan.h>
#include <System/System.h>
***************
*** 21,24 ****
--- 22,34 ----
system=_system;
compilerBinary=_compilerBinary;
+ plan=0;
+ }
+
+ void Compiler::setPlan(CBM::Plan *_plan, int modifyPlanObject)
+ {
+ if ((modifyPlanObject) && (plan))
+ plan->remove(this);
+
+ plan=_plan;
}
***************
*** 50,53 ****
--- 60,64 ----
Compiler::~Compiler()
{
+ setPlan(0, 1);
}
|