compbench-devel Mailing List for CompBenchmarks (Page 23)
Brought to you by:
xfred
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(51) |
Nov
(66) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(242) |
Feb
(56) |
Mar
(95) |
Apr
(120) |
May
(127) |
Jun
(32) |
Jul
(10) |
Aug
(55) |
Sep
(114) |
Oct
(3) |
Nov
|
Dec
|
From: Frederic T. <xf...@us...> - 2007-03-06 19:32:16
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30853 Modified Files: CEL-Atom.cpp CEL-Atom.h Log Message: New CelContainer class. Index: CEL-Atom.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Atom.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CEL-Atom.h 5 Mar 2007 20:32:39 -0000 1.1 --- CEL-Atom.h 6 Mar 2007 19:32:00 -0000 1.2 *************** *** 35,38 **** --- 35,50 ---- virtual ~CelAtom(); }; + + class CelContainer : public CelAtom { + protected: + public: + CelContainer(); + + virtual std::string xmlEntityName(void); + virtual std::string Evaluate(void); + + virtual ~CelContainer(); + }; + } Index: CEL-Atom.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Atom.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CEL-Atom.cpp 5 Mar 2007 20:32:39 -0000 1.1 --- CEL-Atom.cpp 6 Mar 2007 19:32:00 -0000 1.2 *************** *** 98,99 **** --- 98,129 ---- { } + + CelContainer::CelContainer() + : CelAtom() + { + } + + std::string CelContainer::xmlEntityName(void) + { + return("cel"); + } + + std::string CelContainer::Evaluate(void) + { + int i; + int n = childs.size(); + CelAtom *A; + + std::string r; + + for(i=0; i<n; i++) { + A=childs[i]; + r=A->Evaluate(); + } + + return(r); + } + + CelContainer::~CelContainer() + { + } |
From: Frederic T. <xf...@us...> - 2007-03-06 19:31:25
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30458 Modified Files: CEL-Version.cpp CEL-Version.h Log Message: Version is coded both for internal usage (as std::string coding a formated int) and XML usage. Index: CEL-Version.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Version.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CEL-Version.h 5 Mar 2007 20:32:40 -0000 1.1 --- CEL-Version.h 6 Mar 2007 19:31:15 -0000 1.2 *************** *** 25,29 **** --- 25,32 ---- protected: std::string version; + std::string x_version; + virtual std::string xmlEntityName(void); + virtual std::string xmlValue(void); public: Index: CEL-Version.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Version.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CEL-Version.cpp 5 Mar 2007 20:32:40 -0000 1.1 --- CEL-Version.cpp 6 Mar 2007 19:31:15 -0000 1.2 *************** *** 15,18 **** --- 15,19 ---- : CelAtom() { + version=_version; setInternal(_version); updateVersion(); *************** *** 24,27 **** --- 25,33 ---- } + std::string CelVersion::xmlValue(void) + { + return(version); + } + void CelVersion::setInternal(std::string _version) { *************** *** 75,84 **** /* sprintf(c, "%d", internal); */ sprintf(c, "%0*d", digits, internal); ! version=c; } std::string CelVersion::Evaluate(void) { ! return(version); } --- 81,90 ---- /* sprintf(c, "%d", internal); */ sprintf(c, "%0*d", digits, internal); ! x_version=c; } std::string CelVersion::Evaluate(void) { ! return(x_version); } |
From: Frederic T. <xf...@us...> - 2007-03-06 19:30:19
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29963 Added Files: CEL-Include.cpp CEL-Include.h Log Message: First import. --- NEW FILE: CEL-Include.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Include.h,v 1.1 2007/03/06 19:30:01 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELINCLUDE #define H_CBM_CELINCLUDE 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelInclude : public CelAtom { protected: virtual std::string xmlEntityName(void); public: CelInclude(); virtual std::string Evaluate(void); virtual ~CelInclude(); }; } #endif --- NEW FILE: CEL-Include.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Include.cpp,v 1.1 2007/03/06 19:30:01 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Include.h> #include <CEL/CEL-Reader.h> using namespace CBM; CelInclude::CelInclude() : CelAtom() { } std::string CelInclude::xmlEntityName(void) { return("cel-include"); } std::string CelInclude::Evaluate(void) { int n = childs.size(); int i; CelAtom *N; CelAtom *I; std::string r; if (!n) return("0"); for(i=0; i<n; i++) { N=childs[i]; CelReader R(N->Evaluate()); I=R.parse(); r=I->Evaluate(); } return(r); } CelInclude::~CelInclude() { } |
From: Frederic T. <xf...@us...> - 2007-03-05 20:34:15
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27181 Added Files: 05-CEL.pl Log Message: First import. --- NEW FILE: 05-CEL.pl --- #!/usr/bin/perl -w -I .. use strict; use CBM; my $sys; push(@INC, "lib"); require "libtest.pl"; use Test::Simple tests => 84; our $top_srcdir; my $T; my $F; sub test_str { my $str = new CBM::CelStr("xYz"); my $str2 = new CBM::CelStr("000"); ok($str->Evaluate() eq "xYz", "CelStr works"); my $c0 = new CBM::CelStrConcat(); ok($c0->Evaluate() eq "", "CelStrConcat returns an empty string"); $c0->add($str); $c0->add($str2); my $e = $c0->Evaluate(); ok($e eq "xYz000", "CelStrConcat works (has $e)"); } sub test_logic_or { my $or0 = new CBM::CelLogicOr(); my $or1 = new CBM::CelLogicOr(); $or0->add($F); $or0->add($F); ok($or0->Evaluate() eq "0", "F or F is F"); $or1->add($F); $or1->add($T); ok($or0->Evaluate() eq "0", "F or T is T"); $or0->add($or1); ok($or0->Evaluate() eq "1", "F or T is T"); } sub test_logic_and { my $and0 = new CBM::CelLogicAnd(); my $and1 = new CBM::CelLogicAnd(); $and0->add($F); $and0->add($T); ok($and0->Evaluate() eq "0", "F and T is F"); $and1->add($T); $and1->add($T); ok($and1->Evaluate() eq "1", "T and T is T"); $and0->add($and1); ok($and0->Evaluate() eq "0", "F and T is F"); } sub test_version_simple { my @V = ('0.0.0', '0.0', '0.0.0.0', '0.1', '1.0', '1.0.0.0', '0.1.0', '0.1.0.0', '2.95.0', '2.96.3', '2.96.3.1', '2.96.4.10', '4.2.5'); my %V = ('0.0.0' => '00000000', '0.0' => '00000000', '0.0.0.0' => '00000000', '0.1' => '00000001', '1.0' => '00000100', '1.0.0.0' => '01000000', '0.1.0' => '00000100', '0.1.0.0' => '00010000', '2.95.0' => '00029500', '2.96.3' => '00029603', '2.96.3.1' => '02960301', '2.96.4.10' => '02960410', '4.2.5' => '00040205'); my $v; foreach $v (@V) { my $v0 = new CBM::CelVersion($v); my $e; $e=$v0->Evaluate(); ok($e eq $V{$v}, "$v version object is $V{$v} - (has $e)"); } } sub test_math { my $v0 = new CBM::CelStr("0"); my $v1 = new CBM::CelStr("102"); my $I0 = new CBM::CelMathInc(); my $I1 = new CBM::CelMathInc(); $I0->add($v0); ok($I0->Evaluate() eq "1", "inc(0) is 1"); $I1->add($v1); ok($I1->Evaluate() eq "103", "inc(102) is 103"); my $dv0 = new CBM::CelStr("1"); my $dv1 = new CBM::CelStr("102"); my $dI0 = new CBM::CelMathDec(); my $dI1 = new CBM::CelMathDec(); $dI0->add($dv0); ok($dI0->Evaluate() eq "0", "dec(1) is 0"); $dI1->add($dv1); ok($dI1->Evaluate() eq "101", "inc(102) is 101"); } sub test_logic { $T = new CBM::CelLogicTrue(); $F = new CBM::CelLogicFalse(); ok($T->Evaluate() eq "1", "True is 1"); ok($F->Evaluate() eq "0", "False is 0"); test_logic_or(); test_logic_and(); test_version_simple(); my $n0 = new CBM::CelLogicNot(); $n0->add($T); ok($n0->Evaluate() eq "0", "Not(T) is F"); my $n1 = new CBM::CelLogicNot(); $n1->add($F); ok($n1->Evaluate() eq "1", "Not(F) is T"); } sub test_cmp { my $eq0 = new CBM::CelCmpEq(); ok($eq0->Evaluate() eq "0", "eq on empty atom returns F"); $eq0->add($T); ok($eq0->Evaluate() eq "0", "eq on 1 atom returns F"); $eq0->add($F); ok($eq0->Evaluate() eq "0", "eq on (T,F) returns F"); my $eq1 = new CBM::CelCmpEq(); $eq1->add($T); $eq1->add($T); ok($eq1->Evaluate() eq "1", "eq on (F,F) returns T"); my @V = ('0.0.1/0.0.2', '0.1.0/0.1.1', '1.0.0/2.0.0', '2.95.0/2.96.0', '1.10.1/1.11.0', '21.5/22.0'); my $v; foreach $v (@V) { my ($v0, $v1) = split('/', "$v"); my $eq2 = new CBM::CelCmpAE(); my $V0 = new CBM::CelVersion($v0); my $V1 = new CBM::CelVersion($v1); $eq2->add($V0); $eq2->add($V1); ok($eq2->Evaluate() eq "1", "ae on ($v0, $v1) returns T"); my $eq3 = new CBM::CelCmpAE(); $V0 = new CBM::CelVersion($v1); $V1 = new CBM::CelVersion($v0); $eq3->add($V0); $eq3->add($V1); ok($eq3->Evaluate() eq "0", "ae on ($v1, $v0) returns F"); } } sub test_cond { my $c0 = new CBM::CelCondIf(); $c0->add($T); $c0->add($F); ok($c0->Evaluate() eq "0", "if (T) F returns F"); my $c1 = new CBM::CelCondIf(); $c1->add($T); $c1->add($T); ok($c1->Evaluate() eq "1", "if (T) T returns T"); my $c2 = new CBM::CelCondIf(); $c2->add($F); $c2->add($F); $c2->add($T); ok($c2->Evaluate() eq "1", "if (F) F T returns T"); my $c3 = new CBM::CelCondIf(); my $n0 = new CBM::CelLogicNot(); $n0->add($F); $c3->add($n0); $c3->add($T); ok($c3->Evaluate() eq "1", "if (Not(F)) T returns T"); } sub test_var { my $i0 = new CBM::CelStr("x"); my $i1 = new CBM::CelStr("y"); my $v0 = new CBM::CelStr("100"); my $v1 = new CBM::CelStr("201"); my $cs0 = new CBM::CelVarSet(); $cs0->add($i0); $cs0->add($v0); $cs0->Evaluate(); my $cg0 = new CBM::CelVarGet(); $cg0->add($i0); ok($cg0->Evaluate() eq "100", "Set/Get (x=100)"); my $cs1 = new CBM::CelVarSet(); $cs1->add($i1); $cs1->add($v0); $cs1->Evaluate(); my $cg1 = new CBM::CelVarGet(); $cg1->add($i1); ok($cg1->Evaluate() eq "100", "Set/Get (y=100)"); my $cs2 = new CBM::CelVarSet(); $cs2->add($i1); $cs2->add($v1); $cs2->Evaluate(); my $cg2 = new CBM::CelVarGet(); $cg2->add($i1); ok($cg2->Evaluate() eq "201", "Set/Get (y=201) - has " . $cg2->Evaluate()); my $u = new CBM::CelVarUndef(); $u->add($i0); $u->Evaluate(); ok($cg0->Evaluate() eq "0", "Undefined"); } sub test_array_add { my $array = shift; my $str = shift; my $A = new CBM::CelArrayAdd(); my $al = new CBM::CelStr($array); my $ai = new CBM::CelStr($str); $A->add($al); $A->add($ai); $A->Evaluate(); } sub test_array { my $A = new CBM::CelArrayDef(); my $an = new CBM::CelStr("a"); $A->add($an); ok($A->Evaluate() eq "1", "array definition works"); my $AS = new CBM::CelArraySize(); my $ans = new CBM::CelStr("a"); $AS->add($an); ok($AS->Evaluate() eq "0", "array a is empty"); test_array_add("a", "y"); ok($AS->Evaluate() eq "1", "array a has one element"); my $AG = new CBM::CelArrayGet(); my $ags = new CBM::CelStr("a"); my $agi = new CBM::CelStr("0"); $AG->add($ags); $AG->add($agi); my $e = $AG->Evaluate(); ok($e eq "y", "first element in a is 'y' (has $e)"); test_array_add("a", "z"); ok($AS->Evaluate() eq "2", "array a has two element"); ok($AG->Evaluate() eq "y", "first element in a is 'y'"); my $AG2 = new CBM::CelArrayGet(); my $ags2 = new CBM::CelStr("a"); my $agi2 = new CBM::CelStr("1"); $AG2->add($ags2); $AG2->add($agi2); $e=$AG2->Evaluate(); ok($e eq "z", "second element in a is 'z' (has $e)"); } sub test_function_noargs { my $fd = new CBM::CelFunctionDef(); my $fn = new CBM::CelStr("func0"); $fd->add($fn); my $c = new CBM::CelCondIf(); $c->add($F); $c->add($F); $c->add($T); $fd->add($c); ok ($fd->Evaluate() eq "1", "func0() can be declared"); my $fc = new CBM::CelFunctionCall(); my $fnc = new CBM::CelStr("func0"); $fc->add($fnc); my $e = $fc->Evaluate(); ok($e eq "1", "func0() returns T (has $e)"); $e = $fc->Evaluate(); ok($e eq "1", "func0() returns T (has $e) - 2d time"); } sub test_i_stack_pop { my $p = new CBM::CelStackPop(); return($p->Evaluate()); } sub test_i_stack_push { my $str = shift; my $p = new CBM::CelStackPush(); my $v = new CBM::CelStr($str); $p->add($v); return($p->Evaluate()); } sub test_stack { my @v = ('5', 'x', '20'); ok(test_i_stack_pop() eq "0", "stack is empty"); foreach(@v) { ok(test_i_stack_push($_) eq 1, "can push $_ on stack"); } foreach(reverse @v) { ok(test_i_stack_pop() eq $_, "stack (pop) returns $_"); } ok(test_i_stack_pop() eq "0", "stack is empty"); } sub test_i_function_and_call { my $fd = new CBM::CelFunctionCall(); my $fn = new CBM::CelStr("func1"); $fd->add($fn); return($fd->Evaluate()); } sub test_block { my $e; my $b = new CBM::CelBlock(); my $i0 = new CBM::CelStr("a"); my $i1 = new CBM::CelStr("b"); $b->add($i0); $b->add($i1); ok($b->Evaluate() eq "b", "Block evaluated to 'b'"); } sub test_function { my $e; my $fd = new CBM::CelFunctionDef(); my $fn = new CBM::CelStr("func1"); $fd->add($fn); my $i0 = new CBM::CelStr("func1_v0"); my $pop0 = new CBM::CelStackPop(); my $cs0 = new CBM::CelVarSet(); $cs0->add($i0); $cs0->add($pop0); $fd->add($cs0); my $i1 = new CBM::CelStr("func1_v1"); my $pop1 = new CBM::CelStackPop(); my $cs1 = new CBM::CelVarSet(); $cs1->add($i1); $cs1->add($pop1); $fd->add($cs1); my $and = new CBM::CelLogicAnd(); my $ig0 = new CBM::CelStr("func1_v0"); my $cg0 = new CBM::CelVarGet(); $cg0->add($ig0); $and->add($cg0); my $ig1 = new CBM::CelStr("func1_v1"); my $cg1 = new CBM::CelVarGet(); $cg1->add($ig1); $and->add($cg1); my $gp = new CBM::CelStackPush(); $gp->add($and); $fd->add($gp); my $iu0 = new CBM::CelStr("func1_v0"); my $u0 = new CBM::CelVarUndef(); $u0->add($i0); $fd->add($u0); my $iu1 = new CBM::CelStr("func1_v1"); my $u1 = new CBM::CelVarUndef(); $u1->add($i1); $fd->add($u1); my $gpop = new CBM::CelStackPop(); $fd->add($gpop); ok($fd->Evaluate() eq "1", "func1 declared"); $e=test_i_function_and_call(); ok($e eq "0", "func1 without argument returns F (has $e)"); test_i_stack_push("0"); test_i_stack_push("0"); $e=test_i_function_and_call(); ok($e eq "0", "func1(F,F) returns F (has $e)"); ok(test_i_stack_pop() eq "0", "stack is empty"); test_i_stack_push("1"); test_i_stack_push("0"); $e=test_i_function_and_call(); ok($e eq "0", "func1(T,F) returns F (has $e)"); $e=test_i_stack_pop(); ok($e eq "0", "stack is empty (has $e)"); test_i_stack_push("1"); test_i_stack_push("1"); $e=test_i_function_and_call(); ok($e eq "1", "func1(T,T) returns T (has $e)"); $e=test_i_stack_pop(); ok($e eq "0", "stack is empty (has $e)"); } sub test_function_return { my $e; my $fd = new CBM::CelFunctionDef(); my $fn = new CBM::CelStr("func2"); $fd->add($fn); my $r0 = new CBM::CelFunctionReturn(); my $v0 = new CBM::CelStr("v0"); $r0->add($v0); my $r1 = new CBM::CelFunctionReturn(); my $v1 = new CBM::CelStr("v1"); $r1->add($v1); $fd->add($r0); $fd->add($r1); $fd->Evaluate(); my $fc = new CBM::CelFunctionCall(); my $cn = new CBM::CelStr("func2"); $fc->add($cn); $e = $fc->Evaluate(); ok($e eq "v0", "func2() returns v0 (has $e)"); } sub test_loop_break { my $L = new CBM::CelLoop(); my $C = new CBM::CelCmpEq(); my $a0 = new CBM::CelStr("x0"); $C->add($a0); my $a1 = new CBM::CelStr("x0"); $C->add($a1); $L->add($C); my $ca0 = new CBM::CelStr("x0"); my $ca1 = new CBM::CelStr("x1"); my $b0 = new CBM::CelLoopBreak(); $L->add($ca0); $L->add($b0); $L->add($ca1); my $e = $L->Evaluate(); ok($e eq "x0", "break works in loops (returns $e)"); } sub test_loop { my $B = new CBM::CelBlock(); my $i0 = new CBM::CelStr("x"); my $v0 = new CBM::CelStr("10"); my $cs0 = new CBM::CelVarSet(); $cs0->add($i0); $cs0->add($v0); $B->add($cs0); my $L = new CBM::CelLoop(); $B->add($L); my $N = new CBM::CelLogicNot(); $L->add($N); my $C = new CBM::CelCmpEq(); my $a0 = new CBM::CelVarGet(); my $ai0 = new CBM::CelStr("x"); my $v01 = new CBM::CelStr("10"); $a0->add($ai0); $C->add($a0); $C->add($v01); $N->add($C); my $i2 = new CBM::CelStr("x"); my $cs01 = new CBM::CelVarSet(); $cs01->add($i2); my $a1 = new CBM::CelMathInc(); my $a1g = new CBM::CelVarGet(); my $ai1g = new CBM::CelStr("x"); $a1g->add($ai1g); $a1->add($a1g); $cs01->add($a1); $L->add($cs01); my $a2g = new CBM::CelVarGet(); my $ai2g = new CBM::CelStr("x"); $a2g->add($ai2g); $B->add($a2g); my $e = $B->Evaluate(); ok($e eq '10', "while(i++<10); eq 10 (has $e)"); } $sys = CBM::Init(); test_str(); test_logic(); test_math(); test_cmp(); test_cond(); test_var(); test_array(); test_function_noargs(); test_stack(); test_block(); test_function(); test_function_return(); test_loop_break(); test_loop(); $sys->done(); |
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26450 Added Files: CEL-Array.cpp CEL-Array.h CEL-Atom.cpp CEL-Atom.h CEL-Block.cpp CEL-Block.h CEL-Cmp.cpp CEL-Cmp.h CEL-Cond.cpp CEL-Cond.h CEL-Function.cpp CEL-Function.h CEL-Logic.cpp CEL-Logic.h CEL-Loop.cpp CEL-Loop.h CEL-Math.cpp CEL-Math.h CEL-Reader.cpp CEL-Reader.h CEL-Stack.cpp CEL-Stack.h CEL-Str.cpp CEL-Str.h CEL-Var.cpp CEL-Var.h CEL-Version.cpp CEL-Version.h Makefile.am Log Message: First import. --- NEW FILE: CEL-Cond.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Cond.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Cond.h> #include <stdlib.h> using namespace CBM; CelCond::CelCond() : CelAtom() { } CelCond::~CelCond() { } CelCondIf::CelCondIf() : CelCond() { } std::string CelCondIf::xmlEntityName(void) { return("cel-cond-if"); } std::string CelCondIf::Evaluate(void) { int n = childs.size(); CelAtom *C; CelAtom *OK; CelAtom *NOK; if ((n<2) || (n>3)) return("0"); C=childs[0]; OK=childs[1]; if (n==3) NOK=childs[2]; else NOK=0; if (C->Evaluate() == "1") { return(OK->Evaluate()); } else { if (NOK) return(NOK->Evaluate()); else return(0); } } CelCondIf::~CelCondIf() { } --- NEW FILE: CEL-Math.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Math.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Math.h> #include <stdlib.h> using namespace CBM; CelMath::CelMath() : CelAtom() { } CelMath::~CelMath() { } CelMathInc::CelMathInc() : CelMath() { } std::string CelMathInc::xmlEntityName(void) { return("cel-math-inc"); } std::string CelMathInc::Evaluate(void) { int i; int n = childs.size(); CelAtom *A; std::string r; char tmp[32]; if (n!=1) return(0); A=childs[0]; i=atoi(A->Evaluate().c_str()); i++; sprintf(tmp, "%d", i); r=tmp; return(r); } CelMathInc::~CelMathInc() { } CelMathDec::CelMathDec() : CelMath() { } std::string CelMathDec::xmlEntityName(void) { return("cel-math-dec"); } std::string CelMathDec::Evaluate(void) { int i; int n = childs.size(); CelAtom *A; std::string r; char tmp[32]; if (n!=1) return(0); A=childs[0]; i=atoi(A->Evaluate().c_str()); i--; sprintf(tmp, "%d", i); r=tmp; return(r); } CelMathDec::~CelMathDec() { } --- NEW FILE: CEL-Version.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Version.h,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELVERSION #define H_CBM_CELVERSION 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelVersion : public CelAtom { private: int internal; int internal_mul; int digits; void setInternal(std::string _version); void updateVersion(void); protected: std::string version; virtual std::string xmlEntityName(void); public: CelVersion(std::string _version); virtual std::string Evaluate(void); virtual ~CelVersion(); }; } #endif --- NEW FILE: CEL-Block.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Block.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELBLOCK #define H_CBM_CELBLOCK 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelBlock : public CelAtom { protected: virtual std::string xmlEntityName(void); public: CelBlock(); virtual std::string Evaluate(void); virtual ~CelBlock(); }; } #endif --- NEW FILE: CEL-Cond.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Cond.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELCOND #define H_CBM_CELCOND 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelCond : public CelAtom { protected: CelCond(); public: virtual ~CelCond(); }; /** \brief ? */ class CelCondIf : public CelCond { protected: virtual std::string xmlEntityName(void); public: CelCondIf(); virtual std::string Evaluate(void); virtual ~CelCondIf(); }; } #endif --- NEW FILE: CEL-Var.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Var.cpp,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Var.h> using namespace CBM; typedef struct { std::string name; std::string value; } celVar_t; std::vector<celVar_t*> celVars; void CBM::CELVarDone(void) { int i; int n = celVars.size(); std::vector<celVar_t*> ncelVars; celVar_t *V; for(i=0; i<n; i++) { V=celVars[i]; delete(V); } celVars=ncelVars; } celVar_t *celVarGet(std::string _name) { int i; int n = celVars.size(); celVar_t *V; for(i=0; i<n; i++) { V=celVars[i]; if (V->name==_name) return(V); } return(0); } std::string celVarRemove(std::string _name) { celVar_t *cv = celVarGet(_name); celVar_t *V; std::vector<celVar_t*> ncelVars; int i; int n = celVars.size(); if (!cv) return("0"); for(i=0; i<n; i++) { V=celVars[i]; if (V!=cv) ncelVars.push_back(V); } celVars=ncelVars; delete(cv); return("1"); } CelVar::CelVar() : CelAtom() { } CelVar::~CelVar() { } CelVarSet::CelVarSet() : CelVar() { } std::string CelVarSet::xmlEntityName(void) { return("cel-var-set"); } std::string CelVarSet::Evaluate(void) { int n = childs.size(); CelAtom *N; CelAtom *V; std::string name; std::string value; celVar_t *cv; if (n!=2) return("0"); N=childs[0]; V=childs[1]; name=N->Evaluate(); value=V->Evaluate(); cv=celVarGet(name); if (!cv) { cv=new celVar_t; celVars.push_back(cv); } cv->name=name; cv->value=value; return("1"); } CelVarSet::~CelVarSet() { } CelVarGet::CelVarGet() : CelVar() { } std::string CelVarGet::xmlEntityName(void) { return("cel-var-get"); } std::string CelVarGet::Evaluate(void) { int n = childs.size(); CelAtom *N; celVar_t *cv; if (n!=1) return("0"); N=childs[0]; cv=celVarGet(N->Evaluate()); if (cv) return(cv->value); else return("0"); } CelVarGet::~CelVarGet() { } CelVarUndef::CelVarUndef() : CelVar() { } std::string CelVarUndef::xmlEntityName(void) { return("cel-var-undef"); } std::string CelVarUndef::Evaluate(void) { int n = childs.size(); CelAtom *N; if (n!=1) return("0"); N=childs[0]; return(celVarRemove(N->Evaluate())); } CelVarUndef::~CelVarUndef() { } --- NEW FILE: CEL-Math.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Math.h,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELMATH #define H_CBM_CELMATH 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelMath : public CelAtom { protected: public: CelMath(); virtual ~CelMath(); }; /** \brief ? */ class CelMathInc : public CelMath { protected: virtual std::string xmlEntityName(void); public: CelMathInc(); virtual std::string Evaluate(void); virtual ~CelMathInc(); }; /** \brief ? */ class CelMathDec : public CelMath { protected: virtual std::string xmlEntityName(void); public: CelMathDec(); virtual std::string Evaluate(void); virtual ~CelMathDec(); }; } #endif --- NEW FILE: CEL-Array.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Array.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Array.h> #include <stdlib.h> using namespace CBM; typedef struct { std::string name; std::vector<std::string> value; } celArray_t; std::vector<celArray_t*> celArrays; void CBM::CELArrayDone(void) { int i; int n = celArrays.size(); std::vector<celArray_t*> ncelArrays; celArray_t *A; for(i=0; i<n; i++) { A=celArrays[i]; delete(A); } celArrays=ncelArrays; } celArray_t *celArrayGet(std::string _name) { int i; int n = celArrays.size(); celArray_t *A; for(i=0; i<n; i++) { A=celArrays[i]; if (A->name==_name) return(A); } return(0); } std::string celArrayRemove(std::string _name) { celArray_t *ca = celArrayGet(_name); celArray_t *A; std::vector<celArray_t*> ncelArrays; int i; int n = celArrays.size(); if (!ca) return("0"); for(i=0; i<n; i++) { A=celArrays[i]; if (A!=ca) ncelArrays.push_back(A); } celArrays=ncelArrays; delete(ca); return("1"); } CelArray::CelArray() : CelAtom() { } CelArray::~CelArray() { } CelArrayDef::CelArrayDef() : CelArray() { } std::string CelArrayDef::xmlEntityName(void) { return("cel-array-def"); } std::string CelArrayDef::Evaluate(void) { int n = childs.size(); CelAtom *N; std::string name; celArray_t *ca; if (n!=1) return("0"); N=childs[0]; name=N->Evaluate(); ca=celArrayGet(name); if (!ca) { ca=new celArray_t; celArrays.push_back(ca); } ca->name=name; return("1"); } CelArrayDef::~CelArrayDef() { } CelArrayAdd::CelArrayAdd() : CelArray() { } std::string CelArrayAdd::xmlEntityName(void) { return("cel-array-add"); } std::string CelArrayAdd::Evaluate(void) { int n = childs.size(); CelAtom *N; CelAtom *V; std::string name; std::string value; celArray_t *ca; if (n!=2) return("0"); N=childs[0]; V=childs[1]; name=N->Evaluate(); value=V->Evaluate(); ca=celArrayGet(name); if (!ca) { ca=new celArray_t; celArrays.push_back(ca); } ca->name=name; ca->value.push_back(value); return("1"); } CelArrayAdd::~CelArrayAdd() { } CelArraySize::CelArraySize() : CelArray() { } std::string CelArraySize::xmlEntityName(void) { return("cel-array-size"); } std::string CelArraySize::Evaluate(void) { int n = childs.size(); std::string r; CelAtom *N; char tmp[32]; celArray_t *ca; std::string name; if (n!=1) return("0"); N=childs[0]; name=N->Evaluate(); ca=celArrayGet(name); if (!ca) { return("0"); } sprintf(tmp, "%d", ca->value.size()); r=tmp; return(r); } CelArraySize::~CelArraySize() { } CelArrayGet::CelArrayGet() : CelArray() { } std::string CelArrayGet::xmlEntityName(void) { return("cel-array-get"); } std::string CelArrayGet::Evaluate(void) { int n = childs.size(); CelAtom *N; CelAtom *I; std::string is; int i; celArray_t *ca; if (n!=2) return("0"); N=childs[0]; I=childs[1]; is=I->Evaluate(); i=atoi(is.c_str()); ca=celArrayGet(N->Evaluate()); if (ca) { if ((i>=0) && ((unsigned) i<ca->value.size())) return(ca->value[i]); else return("0"); } else return("0"); } CelArrayGet::~CelArrayGet() { } CelArrayUndef::CelArrayUndef() : CelArray() { } std::string CelArrayUndef::xmlEntityName(void) { return("cel-array-undef"); } std::string CelArrayUndef::Evaluate(void) { int n = childs.size(); CelAtom *N; if (n!=1) return("0"); N=childs[0]; return(celArrayRemove(N->Evaluate())); } CelArrayUndef::~CelArrayUndef() { } --- NEW FILE: CEL-Stack.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Stack.cpp,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Stack.h> #include <CEL/CEL-Var.h> #include <stack> using namespace CBM; std::stack<std::string> celStack; CelStack::CelStack() : CelAtom() { } CelStack::~CelStack() { } CelStackPush::CelStackPush() : CelStack() { } std::string CelStackPush::xmlEntityName(void) { return("cel-stack-push"); } std::string CelStackPush::Evaluate(void) { int n = childs.size(); int i; CelAtom *N; if (!n) return("0"); for(i=0; i<n; i++) { N=childs[i]; celStack.push(N->Evaluate()); } return("1"); } CelStackPush::~CelStackPush() { } CelStackPop::CelStackPop() { } std::string CelStackPop::xmlEntityName(void) { return("cel-stack-pop"); } std::string CelStackPop::Evaluate(void) { int n = childs.size(); std::string r; if (n) return("0"); if (!celStack.empty()) { r=celStack.top(); celStack.pop(); return(r); } return("0"); } CelStackPop::~CelStackPop() { } --- NEW FILE: CEL-Array.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Array.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELARRAY #define H_CBM_CELARRAY 1 #include <CEL/CEL-Atom.h> namespace CBM { void CELArrayDone(void); /** \brief ? */ class CelArray : public CelAtom { protected: CelArray(); public: virtual ~CelArray(); }; /** \brief ? */ class CelArrayDef : public CelArray { protected: virtual std::string xmlEntityName(void); public: CelArrayDef(); virtual std::string Evaluate(void); virtual ~CelArrayDef(); }; class CelArrayAdd : public CelArray { protected: virtual std::string xmlEntityName(void); public: CelArrayAdd(); virtual std::string Evaluate(void); virtual ~CelArrayAdd(); }; class CelArraySize : public CelArray { protected: virtual std::string xmlEntityName(void); public: CelArraySize(); virtual std::string Evaluate(void); virtual ~CelArraySize(); }; class CelArrayGet : public CelArray { protected: virtual std::string xmlEntityName(void); public: CelArrayGet(); virtual std::string Evaluate(void); virtual ~CelArrayGet(); }; class CelArrayUndef : public CelArray { protected: virtual std::string xmlEntityName(void); public: CelArrayUndef(); virtual std::string Evaluate(void); virtual ~CelArrayUndef(); }; } #endif --- NEW FILE: CEL-Var.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Var.h,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELVAR #define H_CBM_CELVAR 1 #include <CEL/CEL-Atom.h> namespace CBM { void CELVarDone(void); /** \brief ? */ class CelVar : public CelAtom { protected: CelVar(); public: virtual ~CelVar(); }; /** \brief ? */ class CelVarSet : public CelVar { protected: virtual std::string xmlEntityName(void); public: CelVarSet(); virtual std::string Evaluate(void); virtual ~CelVarSet(); }; class CelVarGet : public CelVar { protected: virtual std::string xmlEntityName(void); public: CelVarGet(); virtual std::string Evaluate(void); virtual ~CelVarGet(); }; class CelVarUndef : public CelVar { protected: virtual std::string xmlEntityName(void); public: CelVarUndef(); virtual std::string Evaluate(void); virtual ~CelVarUndef(); }; } #endif --- NEW FILE: Makefile.am --- # ----------------------------------------------------------------------------- # $Id: Makefile.am,v 1.1 2007/03/05 20:32:40 xfred Exp $ # $Source: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/Makefile.am,v $ # # This is free software. # For details, see the GNU Public License in the COPYING file, or # Look http://www.fsf.org # ----------------------------------------------------------------------------- noinst_LTLIBRARIES = libCEL.la sources = CEL-Atom.cpp CEL-Str.cpp CEL-Logic.cpp \ CEL-Version.cpp CEL-Math.cpp \ CEL-Cmp.cpp CEL-Cond.cpp CEL-Var.cpp \ CEL-Array.cpp \ CEL-Block.cpp CEL-Loop.cpp \ CEL-Function.cpp CEL-Stack.cpp \ CEL-Reader.cpp libCEL_la_SOURCES = $(sources) libPlaninclude_HEADERS = $(sources:.cpp=.h) $(EXTRA_DIST:.cpp=.h) libPlanincludedir = $(includedir)/compbenchmarks/CEL INCLUDES = -I $(top_srcdir)/libcompbenchmarks @XML_CPPFLAGS@ libCEL_la_LIBADD = @XML_LIBS@ --- NEW FILE: CEL-Logic.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Logic.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELLOGIC #define H_CBM_CELLOGIC 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelLogic : public CelAtom { protected: public: CelLogic(); virtual ~CelLogic(); }; /** \brief ? */ class CelLogicTrue : public CelLogic { protected: virtual std::string xmlEntityName(void); public: CelLogicTrue(); virtual std::string Evaluate(void); virtual ~CelLogicTrue(); }; /** \brief ? */ class CelLogicFalse : public CelLogic { protected: virtual std::string xmlEntityName(void); public: CelLogicFalse(); virtual std::string Evaluate(void); virtual ~CelLogicFalse(); }; /** \brief ? */ class CelLogicOr : public CelLogic { protected: virtual std::string xmlEntityName(void); public: CelLogicOr(); virtual std::string Evaluate(void); virtual ~CelLogicOr(); }; /** \brief ? */ class CelLogicAnd : public CelLogic { protected: virtual std::string xmlEntityName(void); public: CelLogicAnd(); virtual std::string Evaluate(void); virtual ~CelLogicAnd(); }; /** \brief ? */ class CelLogicNot : public CelLogic { protected: virtual std::string xmlEntityName(void); public: CelLogicNot(); virtual std::string Evaluate(void); virtual ~CelLogicNot(); }; } #endif --- NEW FILE: CEL-Logic.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Logic.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Logic.h> using namespace CBM; CelLogic::CelLogic() : CelAtom() { } CelLogic::~CelLogic() { } CelLogicTrue::CelLogicTrue() : CelLogic() { } std::string CelLogicTrue::xmlEntityName(void) { return("cel-logic-true"); } std::string CelLogicTrue::Evaluate(void) { return("1"); } CelLogicTrue::~CelLogicTrue() { } CelLogicFalse::CelLogicFalse() : CelLogic() { } std::string CelLogicFalse::xmlEntityName(void) { return("cel-logic-false"); } std::string CelLogicFalse::Evaluate(void) { return("0"); } CelLogicFalse::~CelLogicFalse() { } CelLogicOr::CelLogicOr() : CelLogic() { } std::string CelLogicOr::xmlEntityName(void) { return("cel-logic-or"); } std::string CelLogicOr::Evaluate(void) { int i; int n = childs.size(); CelAtom *A; for(i=0; i<n; i++) { A=childs[i]; if (A->Evaluate() != "0") return("1"); } return("0"); } CelLogicOr::~CelLogicOr() { } CelLogicAnd::CelLogicAnd() : CelLogic() { } std::string CelLogicAnd::xmlEntityName(void) { return("cel-logic-and"); } std::string CelLogicAnd::Evaluate(void) { int i; int n = childs.size(); CelAtom *A; for(i=0; i<n; i++) { A=childs[i]; if (A->Evaluate() == "0") return("0"); } return("1"); } CelLogicAnd::~CelLogicAnd() { } CelLogicNot::CelLogicNot() : CelLogic() { } std::string CelLogicNot::xmlEntityName(void) { return("cel-logic-not"); } std::string CelLogicNot::Evaluate(void) { int n = childs.size(); CelAtom *A; if (n==1) { A=childs[0]; if (A->Evaluate() != "0") return("0"); else return("1"); } return("0"); } CelLogicNot::~CelLogicNot() { } --- NEW FILE: CEL-Block.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Block.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Block.h> using namespace CBM; CelBlock::CelBlock() { } std::string CelBlock::xmlEntityName(void) { return("cel-block"); } std::string CelBlock::Evaluate(void) { int n = childs.size(); int i; CelAtom *A; std::string r = "0"; for(i=0;i<n;i++) { A=childs[i]; r=A->Evaluate(); } return(r); } CelBlock::~CelBlock() { } --- NEW FILE: CEL-Loop.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Loop.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Loop.h> #include <stdlib.h> using namespace CBM; CelLoop::CelLoop() : CelAtom() { } std::string CelLoop::xmlEntityName(void) { return("cel-loop"); } std::string CelLoop::Evaluate(void) { int n = childs.size(); int i; CelAtom *C; CelAtom *A; std::string r; int l_break = 0; if (n<2) return("0"); C=childs[0]; while ((!l_break) && (C->Evaluate() == "1")) { for(i=1; i<n; i++) { A=childs[i]; if (A->xmlEntityName()=="cel-loop-break") { l_break=1; break; } r=A->Evaluate(); } } return(r); } CelLoop::~CelLoop() { } CelLoopBreak::CelLoopBreak() { } std::string CelLoopBreak::xmlEntityName(void) { return("cel-loop-break"); } std::string CelLoopBreak::Evaluate(void) { return("0"); } CelLoopBreak::~CelLoopBreak() { } --- NEW FILE: CEL-Function.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Function.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELFUNCTION #define H_CBM_CELFUNCTION 1 #include <CEL/CEL-Atom.h> namespace CBM { void CELFunctionDone(void); /** \brief ? */ class CelFunction : public CelAtom { protected: CelFunction(); public: virtual ~CelFunction(); }; /** \brief ? */ class CelFunctionDef : public CelFunction { protected: virtual std::string xmlEntityName(void); public: CelFunctionDef(); virtual std::string Evaluate(void); virtual ~CelFunctionDef(); }; class CelFunctionCall : public CelFunction { protected: virtual std::string xmlEntityName(void); public: CelFunctionCall(); virtual std::string Evaluate(void); virtual ~CelFunctionCall(); }; class CelFunctionReturn : public CelFunction { protected: virtual std::string xmlEntityName(void); public: CelFunctionReturn(); virtual std::string Evaluate(void); virtual ~CelFunctionReturn(); }; } #endif --- NEW FILE: CEL-Loop.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Loop.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELLOOP #define H_CBM_CELLOOP 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelLoop : public CelAtom { protected: virtual std::string xmlEntityName(void); public: CelLoop(); virtual std::string Evaluate(void); virtual ~CelLoop(); }; /** \brief ? */ class CelLoopBreak : public CelAtom { protected: virtual std::string xmlEntityName(void); public: CelLoopBreak(); virtual std::string Evaluate(void); virtual ~CelLoopBreak(); }; } #endif --- NEW FILE: CEL-Cmp.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Cmp.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Cmp.h> #include <stdlib.h> using namespace CBM; CelCmp::CelCmp() : CelAtom() { } CelCmp::~CelCmp() { } CelCmpEq::CelCmpEq() : CelCmp() { } std::string CelCmpEq::xmlEntityName(void) { return("cel-cmp-eq"); } std::string CelCmpEq::Evaluate(void) { int i; int n = childs.size(); CelAtom *A; std::string previous; int previousSet = 0; if (n<=1) return("0"); for(i=0; i<n; i++) { A=childs[i]; if (previousSet) { if (A->Evaluate() != previous) return("0"); } else { previousSet=1; previous=A->Evaluate(); } } return("1"); } CelCmpEq::~CelCmpEq() { } CelCmpAE::CelCmpAE() : CelCmp() { } std::string CelCmpAE::xmlEntityName(void) { return("cel-cmp-ae"); } std::string CelCmpAE::Evaluate(void) { int i; int n = childs.size(); CelAtom *A; int previousSet = 0; std::string dum; int tmp; int previous_tmp; if (n<=1) return("0"); for(i=0; i<n; i++) { A=childs[i]; if (previousSet) { dum=A->Evaluate(); tmp=atoi(dum.c_str()); if (tmp < previous_tmp) return("0"); } else { previousSet=1; dum=A->Evaluate(); previous_tmp=atoi(dum.c_str()); } } return("1"); } CelCmpAE::~CelCmpAE() { } --- NEW FILE: CEL-Reader.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Reader.cpp,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Reader.h> #include <CEL/CEL-Atom.h> #include <Base/XMLReader.h> using namespace CBM; CELReader::CELReader(std::string _filename) { CBM::XMLReader r; root=r.read(_filename); } CELAtom *CELReader::parse(void) { CBM::XMLNode *N; int i; int n; if (!root) return(0); n=root->nodeNumber(); for(i=0;i<n;i++) { N=root->getNode(i); if (N->Name()=="cel-str") { } } } CELReader::~CELReader() { } --- NEW FILE: CEL-Function.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Function.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Function.h> using namespace CBM; typedef struct { std::string name; CBM::CelAtom *function; } celFunction_t; std::vector<celFunction_t*> celFunctions; celFunction_t *celFunctionGet(std::string _name) { int i; int n = celFunctions.size(); celFunction_t *F; for(i=0; i<n; i++) { F=celFunctions[i]; if (F->name==_name) return(F); } return(0); } void CBM::CELFunctionDone(void) { } CelFunction::CelFunction() : CelAtom() { } CelFunction::~CelFunction() { } CelFunctionDef::CelFunctionDef() : CelFunction() { } std::string CelFunctionDef::xmlEntityName(void) { return("cel-function-def"); } std::string CelFunctionDef::Evaluate(void) { int n = childs.size(); CelAtom *N; std::string name; celFunction_t *cf; if (n<2) return("0"); N=childs[0]; name=N->Evaluate(); cf=celFunctionGet(name); if (!cf) { cf=new celFunction_t; celFunctions.push_back(cf); cf->name=name; cf->function=this; return("1"); } else return("0"); } CelFunctionDef::~CelFunctionDef() { } CelFunctionCall::CelFunctionCall() { } std::string CelFunctionCall::xmlEntityName(void) { return("cel-function-call"); } std::string CelFunctionCall::Evaluate(void) { int n = childs.size(); int i; CelAtom *N; celFunction_t *cf; std::string r = "0"; if (n!=1) return("0"); N=childs[0]; cf=celFunctionGet(N->Evaluate()); if (cf) { n=cf->function->Childs().size(); for(i=1;i<n;i++) { N=cf->function->Childs()[i]; r=N->Evaluate(); if (N->xmlEntityName()=="cel-function-return") { break; } } return(r); } else return("0"); } CelFunctionCall::~CelFunctionCall() { } CelFunctionReturn::CelFunctionReturn() { } std::string CelFunctionReturn::xmlEntityName(void) { return("cel-function-return"); } std::string CelFunctionReturn::Evaluate(void) { int n = childs.size(); CelAtom *N; std::string r = "0"; if (n!=1) return("0"); N=childs[0]; return(N->Evaluate()); } CelFunctionReturn::~CelFunctionReturn() { } --- NEW FILE: CEL-Version.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Version.cpp,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Version.h> #include <System/System.h> #include <stdlib.h> using namespace CBM; CelVersion::CelVersion(std::string _version) : CelAtom() { setInternal(_version); updateVersion(); } std::string CelVersion::xmlEntityName(void) { return("cel-version"); } void CelVersion::setInternal(std::string _version) { int i = 0; int mul = 1; std::string cur; int tmp; internal=0; internal_mul=0; digits=0; while ( (cur=cbmSystem->Split(_version, ".", i))!="") { tmp=atoi(cur.c_str()); internal+=tmp; internal*=100; mul*=100; i++; digits+=2; } internal/=100; while (digits<8) { digits+=2; mul*=100; } internal_mul=mul; } void CelVersion::updateVersion(void) { /* int inter = internal; int mul = internal_mul; int tmp; char c[16]; version=""; while (mul>1) { tmp=(inter/mul); sprintf(c, "%d", tmp); inter-=(tmp*mul); mul/=100; version+=c; if (mul>1) version+="."; } */ char c[16]; /* sprintf(c, "%d", internal); */ sprintf(c, "%0*d", digits, internal); version=c; } std::string CelVersion::Evaluate(void) { return(version); } CelVersion::~CelVersion() { } --- NEW FILE: CEL-Stack.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Stack.h,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELSTACK #define H_CBM_CELSTACK 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelStack : public CelAtom { protected: CelStack(); public: virtual ~CelStack(); }; /** \brief ? */ class CelStackPush : public CelStack { protected: virtual std::string xmlEntityName(void); public: CelStackPush(); virtual std::string Evaluate(void); virtual ~CelStackPush(); }; class CelStackPop : public CelStack { protected: virtual std::string xmlEntityName(void); public: CelStackPop(); virtual std::string Evaluate(void); virtual ~CelStackPop(); }; } #endif --- NEW FILE: CEL-Reader.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Reader.h,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELREADER #define H_CBM_CELREADER 1 #include <Base/XML.h> namespace CBM { /** \brief Interface to CEL XML files ? */ class CELReader { protected: XMLNode *root; public: /** Constructor */ CELReader(std::string _filename); class CELAtom *parse(void); /** Destructor */ virtual ~CELReader(); }; } #endif --- NEW FILE: CEL-Str.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Str.cpp,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Str.h> using namespace CBM; CelStr::CelStr(std::string _string) : CelAtom() { string=_string; } std::string CelStr::xmlEntityName(void) { return("cel-str"); } std::string CelStr::xmlValue(void) { return(string); } std::string CelStr::Evaluate(void) { return(string); } CelStr::~CelStr() { } CelStrConcat::CelStrConcat() : CelAtom() { } std::string CelStrConcat::xmlEntityName(void) { return("cel-str-concat"); } std::string CelStrConcat::Evaluate(void) { std::string r = ""; int n = childs.size(); int i; CelAtom *A; for(i=0; i<n; i++) { A=childs[i]; r+=A->Evaluate(); } return(r); } CelStrConcat::~CelStrConcat() { } --- NEW FILE: CEL-Str.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Str.h,v 1.1 2007/03/05 20:32:40 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELSTR #define H_CBM_CELSTR 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelStr : public CelAtom { protected: std::string string; virtual std::string xmlEntityName(void); virtual std::string xmlValue(void); public: CelStr(std::string _string); virtual std::string Evaluate(void); virtual ~CelStr(); }; class CelStrConcat : public CelAtom { protected: virtual std::string xmlEntityName(void); public: CelStrConcat(); virtual std::string Evaluate(void); virtual ~CelStrConcat(); }; } #endif --- NEW FILE: CEL-Atom.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Atom.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELATOM #define H_CBM_CELATOM 1 #include <vector> #include <string> namespace CBM { /** \brief ? */ class CelAtom { protected: std::vector<CelAtom *> childs; CelAtom(); virtual void indent(std::string& str, int _indent); virtual std::string xmlValue(void); virtual std::string xmlProperties(void); public: virtual std::string xmlEntityName(void) = 0; virtual std::vector<CelAtom *>& Childs(void); virtual void add(CelAtom *_atom); virtual std::string Evaluate(void) = 0; virtual std::string str(int _indent = 0); virtual ~CelAtom(); }; } #endif --- NEW FILE: CEL-Cmp.h --- /* ---------------------------------------------------------------------------- $Id: CEL-Cmp.h,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_CELCMP #define H_CBM_CELCMP 1 #include <CEL/CEL-Atom.h> namespace CBM { /** \brief ? */ class CelCmp : public CelAtom { protected: public: CelCmp(); virtual ~CelCmp(); }; /** \brief ? */ class CelCmpEq : public CelCmp { protected: virtual std::string xmlEntityName(void); public: CelCmpEq(); virtual std::string Evaluate(void); virtual ~CelCmpEq(); }; /** \brief ? */ class CelCmpAE : public CelCmp { protected: virtual std::string xmlEntityName(void); public: CelCmpAE(); virtual std::string Evaluate(void); virtual ~CelCmpAE(); }; } #endif --- NEW FILE: CEL-Atom.cpp --- /* ---------------------------------------------------------------------------- $Id: CEL-Atom.cpp,v 1.1 2007/03/05 20:32:39 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <CEL/CEL-Atom.h> using namespace CBM; CelAtom::CelAtom() { } void CelAtom::indent(std::string& str, int _indent) { int i = _indent; while (i--) str+=" "; } std::string CelAtom::xmlProperties(void) { return(""); } std::string CelAtom::xmlValue(void) { return(""); } std::vector<CelAtom *>& CelAtom::Childs(void) { return(childs); } void CelAtom::add(CBM::CelAtom *_atom) { childs.push_back(_atom); } std::string CelAtom::str(int _indent) { int i; int n = childs.size(); CelAtom *A; std::string r; std::string p; std::string v; r="<"; r+=xmlEntityName(); p=xmlProperties(); v=xmlValue(); if (p!="") { r+=" "; r+=p; } if (v!="") { r+=">"; r+=v; } if (n) { if (v=="") r+=">\n"; else r+="\n"; for(i=0;i<n;i++) { A=childs[i]; indent(r, _indent+1); r+=A->str(_indent+1); } indent(r,_indent); r+="</"; r+=xmlEntityName(); r+=">\n"; } else { if (v=="") r+="/>\n"; else { r+="</"; r+=xmlEntityName(); r+=">\n"; } } return(r); } CelAtom::~CelAtom() { } |
From: Frederic T. <xf...@us...> - 2007-03-05 18:59:32
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6565/CEL Log Message: Directory /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL added to the repository |
From: Frederic T. <xf...@us...> - 2007-02-19 20:49:24
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6553 Modified Files: Makefile.am Log Message: perl directory added. Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 22 Jan 2007 18:24:45 -0000 1.2 --- Makefile.am 19 Feb 2007 20:49:21 -0000 1.3 *************** *** 8,10 **** # ----------------------------------------------------------------------------- ! SUBDIRS = patches system \ No newline at end of file --- 8,10 ---- # ----------------------------------------------------------------------------- ! SUBDIRS = patches system perl \ No newline at end of file |
From: Frederic T. <xf...@us...> - 2007-02-19 20:48:51
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6185 Modified Files: Makefile.am Log Message: Optional link to .libs/libCBM.so (may prevent bad timestamp checking). Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.am 5 Feb 2007 20:04:13 -0000 1.14 --- Makefile.am 19 Feb 2007 20:48:44 -0000 1.15 *************** *** 55,59 **** CBM.so: libCBM.la ! ln -sf .libs/libCBM.so CBM.so all-local: CBM.so --- 55,59 ---- CBM.so: libCBM.la ! if test ! -e CBM.so; then ln -sf .libs/libCBM.so CBM.so; fi all-local: CBM.so |
From: Frederic T. <xf...@us...> - 2007-02-19 18:44:39
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24390 Modified Files: 07-compbenchmarks-core.pl Log Message: Fixed tests on -qip and -qib. Index: 07-compbenchmarks-core.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/07-compbenchmarks-core.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** 07-compbenchmarks-core.pl 6 Feb 2007 19:29:59 -0000 1.3 --- 07-compbenchmarks-core.pl 19 Feb 2007 18:44:29 -0000 1.4 *************** *** 11,15 **** use CBM::LibUI; ! use Test::Simple tests => 105; sub test_options { --- 11,15 ---- use CBM::LibUI; ! use Test::Simple tests => 107; sub test_options { *************** *** 17,24 **** ['-h', 0, '.+'], ['-qap', 0, '.+'], ! ['-qip', 0, '.+'], ['-qi -pgzip', 255, ''], ['-qa', 255, ''], ['-qa -pgzip', 255, ''], ['-q -pgzip', 0, '.+'], ['-qi', 255, ''], --- 17,25 ---- ['-h', 0, '.+'], ['-qap', 0, '.+'], ! ['-qip', 0, '.*'], ['-qi -pgzip', 255, ''], ['-qa', 255, ''], ['-qa -pgzip', 255, ''], + ['-q -cnotthis', 255, ''], ['-q -pgzip', 0, '.+'], ['-qi', 255, ''], *************** *** 29,33 **** ['-qab', 0, '.+'], ['-qab -bgzip-1c', 255, ''], ! ['-qib', 0, '.+'], ['-qib -bgzip-1c', 255, ''], ['-q -bgzip-1c', 0, '.+'], --- 30,34 ---- ['-qab', 0, '.+'], ['-qab -bgzip-1c', 255, ''], ! ['-qib', 0, '.*'], ['-qib -bgzip-1c', 255, ''], ['-q -bgzip-1c', 0, '.+'], |
From: Frederic T. <xf...@us...> - 2007-02-19 18:44:10
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-TCC In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24021 Modified Files: Compiler-TCC.cpp Compiler-TCC.h Log Message: std::string used to avoid memory hits outside data block. Index: Compiler-TCC.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-TCC/Compiler-TCC.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-TCC.h 6 Feb 2007 19:42:03 -0000 1.2 --- Compiler-TCC.h 19 Feb 2007 18:44:02 -0000 1.3 *************** *** 22,30 **** virtual std::string getCompilerName(void); virtual std::string getCompilerVersion(void); ! virtual char *Language(void); public: CompilerTCC (class System *_system, ! char *_compilerBinary); virtual std::string compiler(void); --- 22,30 ---- virtual std::string getCompilerName(void); virtual std::string getCompilerVersion(void); ! virtual std::string Language(void); public: CompilerTCC (class System *_system, ! std::string _compilerBinary); virtual std::string compiler(void); Index: Compiler-TCC.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-TCC/Compiler-TCC.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-TCC.cpp 6 Feb 2007 19:42:03 -0000 1.2 --- Compiler-TCC.cpp 19 Feb 2007 18:44:02 -0000 1.3 *************** *** 13,17 **** CompilerTCC::CompilerTCC(System *_system, ! char *_compilerBinary) : Compiler(_system, _compilerBinary) { --- 13,17 ---- CompilerTCC::CompilerTCC(System *_system, ! std::string _compilerBinary) : Compiler(_system, _compilerBinary) { *************** *** 44,48 **** } ! char *CompilerTCC::Language(void) { return("C"); --- 44,48 ---- } ! std::string CompilerTCC::Language(void) { return("C"); |
From: Frederic T. <xf...@us...> - 2007-02-19 18:43:56
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-GCC In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24006 Modified Files: Compiler-GCC.cpp Compiler-GCC.h Log Message: std::string used to avoid memory hits outside data block. Index: Compiler-GCC.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-GCC/Compiler-GCC.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-GCC.h 6 Feb 2007 19:41:44 -0000 1.2 --- Compiler-GCC.h 19 Feb 2007 18:43:50 -0000 1.3 *************** *** 22,30 **** virtual std::string getCompilerName(void); virtual std::string getCompilerVersion(void); ! virtual char *Language(void); public: CompilerGCC(class System *_system, ! char *_compilerBinary); virtual std::string compiler(void); --- 22,30 ---- virtual std::string getCompilerName(void); virtual std::string getCompilerVersion(void); ! virtual std::string Language(void); public: CompilerGCC(class System *_system, ! std::string _compilerBinary); virtual std::string compiler(void); *************** *** 42,50 **** virtual std::string getCompilerName(void); virtual std::string getCompilerVersion(void); ! virtual char *Language(void); public: CompilerGCC_cpp (class System *_system, ! char *_compilerBinary); virtual std::string compiler(void); --- 42,50 ---- virtual std::string getCompilerName(void); virtual std::string getCompilerVersion(void); ! virtual std::string Language(void); public: CompilerGCC_cpp (class System *_system, ! std::string _compilerBinary); virtual std::string compiler(void); Index: Compiler-GCC.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-GCC/Compiler-GCC.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-GCC.cpp 6 Feb 2007 19:41:44 -0000 1.2 --- Compiler-GCC.cpp 19 Feb 2007 18:43:50 -0000 1.3 *************** *** 15,19 **** CompilerGCC::CompilerGCC(CBM::System *_system, ! char *_compilerBinary) : Compiler(_system, _compilerBinary) { --- 15,19 ---- CompilerGCC::CompilerGCC(CBM::System *_system, ! std::string _compilerBinary) : Compiler(_system, _compilerBinary) { *************** *** 67,71 **** } ! char *CompilerGCC::Language(void) { return("C"); --- 67,71 ---- } ! std::string CompilerGCC::Language(void) { return("C"); *************** *** 77,81 **** CompilerGCC_cpp::CompilerGCC_cpp(CBM::System *_system, ! char *_compilerBinary) : Compiler(_system, _compilerBinary) { --- 77,81 ---- CompilerGCC_cpp::CompilerGCC_cpp(CBM::System *_system, ! std::string _compilerBinary) : Compiler(_system, _compilerBinary) { *************** *** 129,133 **** } ! char *CompilerGCC_cpp::Language(void) { return("C++"); --- 129,133 ---- } ! std::string CompilerGCC_cpp::Language(void) { return("C++"); |
From: Frederic T. <xf...@us...> - 2007-02-19 18:43:43
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23989 Modified Files: Compiler.cpp Compiler.h Log Message: std::string used to avoid memory hits outside data block. Index: Compiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Compiler.h 15 Feb 2007 18:58:05 -0000 1.4 --- Compiler.h 19 Feb 2007 18:43:38 -0000 1.5 *************** *** 55,59 **** \sa Compiler() */ ! char *compilerBinary; /** Constructor --- 55,59 ---- \sa Compiler() */ ! std::string compilerBinary; /** Constructor *************** *** 61,65 **** \param _compilerBinary absolute or relative path to the compiler program */ Compiler(class System *_system, ! char *_compilerBinary); /** Gets compiler's name --- 61,65 ---- \param _compilerBinary absolute or relative path to the compiler program */ Compiler(class System *_system, ! std::string _compilerBinary); /** Gets compiler's name *************** *** 95,99 **** /** Gets compiler's language. \return C or C++. */ ! virtual char *Language(void) = 0; /** Virtual destructor */ virtual ~Compiler(); --- 95,99 ---- /** Gets compiler's language. \return C or C++. */ ! virtual std::string Language(void) = 0; /** Virtual destructor */ virtual ~Compiler(); *************** *** 118,122 **** * \param compilerBinary Absolute or relative name of the compiler program */ ! Compiler *select(char *compilerBinary); /** Virtual destructor */ --- 118,122 ---- * \param compilerBinary Absolute or relative name of the compiler program */ ! Compiler *select(std::string compilerBinary); /** Virtual destructor */ Index: Compiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Compiler.cpp 15 Feb 2007 18:58:05 -0000 1.3 --- Compiler.cpp 19 Feb 2007 18:43:38 -0000 1.4 *************** *** 17,22 **** using namespace CBM; ! Compiler::Compiler(System *_system, ! char *_compilerBinary) { system=_system; --- 17,22 ---- using namespace CBM; ! Compiler::Compiler(System *_system, ! std::string _compilerBinary) { system=_system; *************** *** 68,72 **** } ! Compiler *CompilerSelector::select(char *compilerBinary) { std::string cmd; --- 68,72 ---- } ! Compiler *CompilerSelector::select(std::string compilerBinary) { std::string cmd; |
From: Frederic T. <xf...@us...> - 2007-02-19 18:42:56
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23630 Modified Files: Plan.cpp Log Message: Exits if an invalid compiler is given to add(CBM::Compiler*). Index: Plan.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Plan.cpp 15 Feb 2007 18:59:19 -0000 1.7 --- Plan.cpp 19 Feb 2007 18:42:51 -0000 1.8 *************** *** 132,136 **** int Plan::add(CBM::Compiler *_compiler) { ! if (!isUnique(_compiler)) { return(0); } --- 132,136 ---- int Plan::add(CBM::Compiler *_compiler) { ! if ((!_compiler) || (!isUnique(_compiler))) { return(0); } *************** *** 155,159 **** int Plan::add(CBM::Benchmark *_benchmark) { ! if (!isUnique(_benchmark)) { return(0); } --- 155,159 ---- int Plan::add(CBM::Benchmark *_benchmark) { ! if ((!_benchmark) || (!isUnique(_benchmark))) { return(0); } |
From: Frederic T. <xf...@us...> - 2007-02-19 18:42:25
|
Update of /cvsroot/compbench/CompBenchmarks++ In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23598 Modified Files: cloptions.cpp Log Message: Exits if an invalid compiler is given to -qc Index: cloptions.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/cloptions.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** cloptions.cpp 15 Feb 2007 19:09:20 -0000 1.21 --- cloptions.cpp 19 Feb 2007 18:42:14 -0000 1.22 *************** *** 457,460 **** --- 457,465 ---- } if (filter.compiler) { + if (!C) { + std::cerr << "Invalid compiler given" << std::endl; + parseExitValue=255; + break; + } std::cout << "Compiler name : " << C->Name() << std::endl << "Version : " << C->Version() << std::endl |
From: Frederic T. <xf...@us...> - 2007-02-15 19:12:39
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26591 Modified Files: 05-Plan.pl 06-CBM-LibUI.pl Log Message: More tests. Index: 05-Plan.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/05-Plan.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 05-Plan.pl 26 Jan 2007 13:09:57 -0000 1.5 --- 05-Plan.pl 15 Feb 2007 19:12:33 -0000 1.6 *************** *** 115,119 **** $X=$R->read("$top_srcdir/reference/plan.xml"); ok($P->restore($X) == 1); - my $x = `cat $top_srcdir/reference/plan.xml`; chomp($x); --- 115,118 ---- Index: 06-CBM-LibUI.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/06-CBM-LibUI.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 06-CBM-LibUI.pl 30 Jan 2007 19:11:44 -0000 1.1 --- 06-CBM-LibUI.pl 15 Feb 2007 19:12:33 -0000 1.2 *************** *** 11,15 **** use CBM::LibUI; ! use Test::Simple tests => 225; my $EXPECTED_PACKAGES = 7; --- 11,15 ---- use CBM::LibUI; ! use Test::Simple tests => 230; my $EXPECTED_PACKAGES = 7; *************** *** 85,88 **** --- 85,100 ---- ok($plan->compilerOptionNumber()==0); ok($plan->benchmarkNumber()==0); + + my $B = $libui->cbmSystem()->Benchmark('gzip-1c'); + $plan->add($B); + my @B = $libui->plannedBenchmarks(); + ok(@B==1); + ok($plan->benchmarkNumber()==1); + ok($plan->getBenchmark(0)->Name() eq $B->Name()); + $plan->remove($B); + + @B = $libui->plannedBenchmarks(); + ok(@B==0); + ok($plan->benchmarkNumber()==0); } |
From: Frederic T. <xf...@us...> - 2007-02-15 19:09:28
|
Update of /cvsroot/compbench/CompBenchmarks++ In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv25331 Modified Files: cloptions.cpp Log Message: Fixes on -m [-I|-U] handling. Index: cloptions.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/cloptions.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** cloptions.cpp 7 Feb 2007 17:36:58 -0000 1.20 --- cloptions.cpp 15 Feb 2007 19:09:20 -0000 1.21 *************** *** 624,629 **** --- 624,631 ---- std::cerr << "action not specified." << std::endl; std::cerr << "Valid options are -I and -U." << std::endl; + parseExitValue=255; break; } + break; case DomainLowLevel: if (filter.host) { |
From: Frederic T. <xf...@us...> - 2007-02-15 19:03:37
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22984 Modified Files: CBM.pm CBM_wrap.cxx Log Message: API changes. Index: CBM.pm =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CBM.pm 5 Feb 2007 20:03:22 -0000 1.18 --- CBM.pm 15 Feb 2007 19:03:24 -0000 1.19 *************** *** 55,58 **** --- 55,99 ---- *c_str = *CBMc::c_str; + ############# Class : CBM::BenchmarkCached ############## + + package CBM::BenchmarkCached; + use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); + @ISA = qw( CBM ); + %OWNER = (); + %ITERATORS = (); + *swig_id_get = *CBMc::BenchmarkCached_id_get; + *swig_id_set = *CBMc::BenchmarkCached_id_set; + *swig_instance_get = *CBMc::BenchmarkCached_instance_get; + *swig_instance_set = *CBMc::BenchmarkCached_instance_set; + sub new { + my $pkg = shift; + my $self = CBMc::new_BenchmarkCached(@_); + bless $self, $pkg if defined($self); + } + + sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + CBMc::delete_BenchmarkCached($self); + delete $OWNER{$self}; + } + } + + sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; + } + + sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; + } + + ############# Class : CBM::Package ############## *************** *** 71,74 **** --- 112,116 ---- *Tested = *CBMc::Package_Tested; *Benchmarked = *CBMc::Package_Benchmarked; + *removeCached = *CBMc::Package_removeCached; *hasPatch = *CBMc::Package_hasPatch; *resetContext = *CBMc::Package_resetContext; *************** *** 107,110 **** --- 149,153 ---- *Uninstall = *CBMc::Package_Uninstall; *getStatus = *CBMc::Package_getStatus; + *getStatusStr = *CBMc::Package_getStatusStr; sub DESTROY { return unless $_[0]->isa('HASH'); *************** *** 139,142 **** --- 182,186 ---- %ITERATORS = (); *Package = *CBMc::Benchmark_Package; + *setPlan = *CBMc::Benchmark_setPlan; *Name = *CBMc::Benchmark_Name; *Comments = *CBMc::Benchmark_Comments; *************** *** 423,429 **** *Split = *CBMc::System_Split; *Chomp = *CBMc::System_Chomp; - *display = *CBMc::System_display; *Program = *CBMc::System_Program; - *displayPrograms = *CBMc::System_displayPrograms; *exec = *CBMc::System_exec; *md5 = *CBMc::System_md5; --- 467,471 ---- *************** *** 461,470 **** %OWNER = (); %ITERATORS = (); ! *display = *CBMc::Compiler_display; *compiler = *CBMc::Compiler_compiler; ! *compilerName = *CBMc::Compiler_compilerName; ! *compilerVersion = *CBMc::Compiler_compilerVersion; *Binary = *CBMc::Compiler_Binary; ! *language = *CBMc::Compiler_language; sub DESTROY { return unless $_[0]->isa('HASH'); --- 503,512 ---- %OWNER = (); %ITERATORS = (); ! *setPlan = *CBMc::Compiler_setPlan; *compiler = *CBMc::Compiler_compiler; ! *Name = *CBMc::Compiler_Name; ! *Version = *CBMc::Compiler_Version; *Binary = *CBMc::Compiler_Binary; ! *Language = *CBMc::Compiler_Language; sub DESTROY { return unless $_[0]->isa('HASH'); *************** *** 604,607 **** $cbmSystem= \%__cbmSystem_hash; bless $cbmSystem, CBM::System; ! *CBM_PLAN = *CBMc::CBM_PLAN; 1; --- 646,649 ---- $cbmSystem= \%__cbmSystem_hash; bless $cbmSystem, CBM::System; ! *H_CBM_PLAN = *CBMc::H_CBM_PLAN; 1; Index: CBM_wrap.cxx =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM_wrap.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CBM_wrap.cxx 5 Feb 2007 20:03:22 -0000 1.18 --- CBM_wrap.cxx 15 Feb 2007 19:03:24 -0000 1.19 *************** *** 1428,1450 **** #define SWIGTYPE_p_CBM__Benchmark swig_types[0] ! #define SWIGTYPE_p_CBM__Compiler swig_types[1] ! #define SWIGTYPE_p_CBM__CompilerSelector swig_types[2] ! #define SWIGTYPE_p_CBM__Config swig_types[3] ! #define SWIGTYPE_p_CBM__Package swig_types[4] ! #define SWIGTYPE_p_CBM__Plan swig_types[5] ! #define SWIGTYPE_p_CBM__Result swig_types[6] ! #define SWIGTYPE_p_CBM__System swig_types[7] ! #define SWIGTYPE_p_CBM__XMLAttribute swig_types[8] ! #define SWIGTYPE_p_CBM__XMLNode swig_types[9] ! #define SWIGTYPE_p_CBM__XMLReader swig_types[10] ! #define SWIGTYPE_p_Compiler swig_types[11] ! #define SWIGTYPE_p_CompilerOptions swig_types[12] ! #define SWIGTYPE_p_XMLNode swig_types[13] ! #define SWIGTYPE_p_char swig_types[14] ! #define SWIGTYPE_p_std__string swig_types[15] ! #define SWIGTYPE_p_std__vectorTstd__string_t swig_types[16] ! #define SWIGTYPE_p_time_t swig_types[17] ! static swig_type_info *swig_types[19]; ! static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) --- 1428,1452 ---- #define SWIGTYPE_p_CBM__Benchmark swig_types[0] ! #define SWIGTYPE_p_CBM__BenchmarkCached swig_types[1] ! #define SWIGTYPE_p_CBM__Compiler swig_types[2] ! #define SWIGTYPE_p_CBM__CompilerSelector swig_types[3] ! #define SWIGTYPE_p_CBM__Config swig_types[4] ! #define SWIGTYPE_p_CBM__Package swig_types[5] ! #define SWIGTYPE_p_CBM__Plan swig_types[6] ! #define SWIGTYPE_p_CBM__Result swig_types[7] ! #define SWIGTYPE_p_CBM__System swig_types[8] ! #define SWIGTYPE_p_CBM__XMLAttribute swig_types[9] ! #define SWIGTYPE_p_CBM__XMLNode swig_types[10] ! #define SWIGTYPE_p_CBM__XMLReader swig_types[11] ! #define SWIGTYPE_p_Compiler swig_types[12] ! #define SWIGTYPE_p_CompilerOptions swig_types[13] ! #define SWIGTYPE_p_XMLNode swig_types[14] ! #define SWIGTYPE_p_char swig_types[15] ! #define SWIGTYPE_p_std__string swig_types[16] ! #define SWIGTYPE_p_std__vectorTCBM__BenchmarkCached_p_t swig_types[17] ! #define SWIGTYPE_p_std__vectorTstd__string_t swig_types[18] ! #define SWIGTYPE_p_time_t swig_types[19] ! static swig_type_info *swig_types[21]; ! static swig_module_info swig_module = {swig_types, 20, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) *************** *** 1798,1801 **** --- 1800,1809 ---- + #include <Plan/Plan.h> + + + #include <Plan/Plan.h> + + SWIGINTERN int SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) *************** *** 1856,1859 **** --- 1864,1873 ---- } + + #include <Plan/Plan.h> + + + #include <Benchmark/Benchmark.h> + #ifdef PERL_OBJECT #define MAGIC_CLASS _wrap_CBM_var:: *************** *** 2063,2066 **** --- 2077,2303 ---- + XS(_wrap_BenchmarkCached_id_set) { + { + CBM::BenchmarkCached *arg1 = (CBM::BenchmarkCached *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: BenchmarkCached_id_set(self,id);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__BenchmarkCached, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BenchmarkCached_id_set" "', argument " "1"" of type '" "CBM::BenchmarkCached *""'"); + } + arg1 = reinterpret_cast< CBM::BenchmarkCached * >(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string SWIG_PERL_CALL_ARGS_2(ST(1), &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BenchmarkCached_id_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "BenchmarkCached_id_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->id = *arg2; + + + + if (SWIG_IsNewObj(res2)) delete arg2; + XSRETURN(argvi); + fail: + + if (SWIG_IsNewObj(res2)) delete arg2; + SWIG_croak_null(); + } + } + + + XS(_wrap_BenchmarkCached_id_get) { + { + CBM::BenchmarkCached *arg1 = (CBM::BenchmarkCached *) 0 ; + std::string *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: BenchmarkCached_id_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__BenchmarkCached, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BenchmarkCached_id_get" "', argument " "1"" of type '" "CBM::BenchmarkCached *""'"); + } + arg1 = reinterpret_cast< CBM::BenchmarkCached * >(argp1); + { + std::string const &_result_ref = ((arg1)->id); + result = (std::string *) &_result_ref; + } + ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(*result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + + XS(_wrap_BenchmarkCached_instance_set) { + { + CBM::BenchmarkCached *arg1 = (CBM::BenchmarkCached *) 0 ; + CBM::Benchmark *arg2 = (CBM::Benchmark *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: BenchmarkCached_instance_set(self,instance);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__BenchmarkCached, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BenchmarkCached_instance_set" "', argument " "1"" of type '" "CBM::BenchmarkCached *""'"); + } + arg1 = reinterpret_cast< CBM::BenchmarkCached * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_CBM__Benchmark, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BenchmarkCached_instance_set" "', argument " "2"" of type '" "CBM::Benchmark *""'"); + } + arg2 = reinterpret_cast< CBM::Benchmark * >(argp2); + if (arg1) (arg1)->instance = arg2; + + + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } + } + + + XS(_wrap_BenchmarkCached_instance_get) { + { + CBM::BenchmarkCached *arg1 = (CBM::BenchmarkCached *) 0 ; + CBM::Benchmark *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: BenchmarkCached_instance_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__BenchmarkCached, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BenchmarkCached_instance_get" "', argument " "1"" of type '" "CBM::BenchmarkCached *""'"); + } + arg1 = reinterpret_cast< CBM::BenchmarkCached * >(argp1); + result = (CBM::Benchmark *) ((arg1)->instance); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CBM__Benchmark, 0 | SWIG_SHADOW); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + + XS(_wrap_new_BenchmarkCached) { + { + CBM::BenchmarkCached *result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: new_BenchmarkCached();"); + } + result = (CBM::BenchmarkCached *)new CBM::BenchmarkCached(); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CBM__BenchmarkCached, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } + } + + + XS(_wrap_delete_BenchmarkCached) { + { + CBM::BenchmarkCached *arg1 = (CBM::BenchmarkCached *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_BenchmarkCached(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__BenchmarkCached, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BenchmarkCached" "', argument " "1"" of type '" "CBM::BenchmarkCached *""'"); + } + arg1 = reinterpret_cast< CBM::BenchmarkCached * >(argp1); + delete arg1; + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + + XS(_wrap_Package_removeCached) { + { + CBM::Package *arg1 = (CBM::Package *) 0 ; + CBM::Benchmark *arg2 = (CBM::Benchmark *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Package_removeCached(self,_benchmark);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Package, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Package_removeCached" "', argument " "1"" of type '" "CBM::Package *""'"); + } + arg1 = reinterpret_cast< CBM::Package * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_CBM__Benchmark, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Package_removeCached" "', argument " "2"" of type '" "CBM::Benchmark *""'"); + } + arg2 = reinterpret_cast< CBM::Benchmark * >(argp2); + (arg1)->removeCached(arg2); + + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } + } + + XS(_wrap_Package_hasPatch) { { *************** *** 2168,2172 **** result = (CBM::BenchmarkVector *) &_result_ref; } ! ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTstd__string_t, 0 | 0); argvi++ ; XSRETURN(argvi); --- 2405,2409 ---- result = (CBM::BenchmarkVector *) &_result_ref; } ! ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTCBM__BenchmarkCached_p_t, 0 | 0); argvi++ ; XSRETURN(argvi); *************** *** 4172,4175 **** --- 4409,4440 ---- + XS(_wrap_Package_getStatusStr) { + { + CBM::Package *arg1 = (CBM::Package *) 0 ; + std::string result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Package_getStatusStr(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Package, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Package_getStatusStr" "', argument " "1"" of type '" "CBM::Package *""'"); + } + arg1 = reinterpret_cast< CBM::Package * >(argp1); + result = (arg1)->getStatusStr(); + ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + XS(_wrap_delete_Package) { { *************** *** 4228,4231 **** --- 4493,4543 ---- + XS(_wrap_Benchmark_setPlan) { + { + CBM::Benchmark *arg1 = (CBM::Benchmark *) 0 ; + CBM::Plan *arg2 = (CBM::Plan *) 0 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: Benchmark_setPlan(self,_plan,modifyPlanObject);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Benchmark, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Benchmark_setPlan" "', argument " "1"" of type '" "CBM::Benchmark *""'"); + } + arg1 = reinterpret_cast< CBM::Benchmark * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_CBM__Plan, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Benchmark_setPlan" "', argument " "2"" of type '" "CBM::Plan *""'"); + } + arg2 = reinterpret_cast< CBM::Plan * >(argp2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Benchmark_setPlan" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + (arg1)->setPlan(arg2,arg3); + + + + + XSRETURN(argvi); + fail: + + + + SWIG_croak_null(); + } + } + + XS(_wrap_Benchmark_Name) { { *************** *** 8030,8060 **** - XS(_wrap_System_display) { - { - CBM::System *arg1 = (CBM::System *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: System_display(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__System, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "System_display" "', argument " "1"" of type '" "CBM::System *""'"); - } - arg1 = reinterpret_cast< CBM::System * >(argp1); - (arg1)->display(); - - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } - } - - XS(_wrap_System_Program) { { --- 8342,8345 ---- *************** *** 8097,8127 **** - XS(_wrap_System_displayPrograms) { - { - CBM::System *arg1 = (CBM::System *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: System_displayPrograms(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__System, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "System_displayPrograms" "', argument " "1"" of type '" "CBM::System *""'"); - } - arg1 = reinterpret_cast< CBM::System * >(argp1); - (arg1)->displayPrograms(); - - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } - } - - XS(_wrap_System_exec) { { --- 8382,8385 ---- *************** *** 8732,8752 **** ! XS(_wrap_Compiler_display) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; ! if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_display(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_display" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! (arg1)->display(); --- 8990,9028 ---- ! XS(_wrap_Compiler_setPlan) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; + CBM::Plan *arg2 = (CBM::Plan *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; int argvi = 0; dXSARGS; ! if ((items < 3) || (items > 3)) { ! SWIG_croak("Usage: Compiler_setPlan(self,_plan,modifyPlanObject);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_setPlan" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_CBM__Plan, 0 | 0 ); ! if (!SWIG_IsOK(res2)) { ! SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Compiler_setPlan" "', argument " "2"" of type '" "CBM::Plan *""'"); ! } ! arg2 = reinterpret_cast< CBM::Plan * >(argp2); ! ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); ! if (!SWIG_IsOK(ecode3)) { ! SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Compiler_setPlan" "', argument " "3"" of type '" "int""'"); ! } ! arg3 = static_cast< int >(val3); ! (arg1)->setPlan(arg2,arg3); ! ! *************** *** 8754,8757 **** --- 9030,9035 ---- fail: + + SWIG_croak_null(); } *************** *** 8787,8791 **** ! XS(_wrap_Compiler_compilerName) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; --- 9065,9069 ---- ! XS(_wrap_Compiler_Name) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; *************** *** 8797,8808 **** if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_compilerName(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_compilerName" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! result = (arg1)->compilerName(); ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(result)); argvi++ ; --- 9075,9086 ---- if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_Name(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_Name" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! result = (arg1)->Name(); ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(result)); argvi++ ; *************** *** 8815,8819 **** ! XS(_wrap_Compiler_compilerVersion) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; --- 9093,9097 ---- ! XS(_wrap_Compiler_Version) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; *************** *** 8825,8836 **** if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_compilerVersion(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_compilerVersion" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! result = (arg1)->compilerVersion(); ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(result)); argvi++ ; --- 9103,9114 ---- if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_Version(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_Version" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! result = (arg1)->Version(); ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(result)); argvi++ ; *************** *** 8871,8875 **** ! XS(_wrap_Compiler_language) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; --- 9149,9153 ---- ! XS(_wrap_Compiler_Language) { { CBM::Compiler *arg1 = (CBM::Compiler *) 0 ; *************** *** 8881,8892 **** if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_language(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_language" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! result = (char *)(arg1)->language(); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; --- 9159,9170 ---- if ((items < 1) || (items > 1)) { ! SWIG_croak("Usage: Compiler_Language(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBM__Compiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { ! SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Compiler_Language" "', argument " "1"" of type '" "CBM::Compiler *""'"); } arg1 = reinterpret_cast< CBM::Compiler * >(argp1); ! result = (char *)(arg1)->Language(); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; *************** *** 10309,10312 **** --- 10587,10591 ---- static swig_type_info _swigt__p_CBM__Benchmark = {"_p_CBM__Benchmark", "CBM::Benchmark *", 0, 0, (void*)"CBM::Benchmark", 0}; + static swig_type_info _swigt__p_CBM__BenchmarkCached = {"_p_CBM__BenchmarkCached", "CBM::BenchmarkCached *", 0, 0, (void*)"CBM::BenchmarkCached", 0}; static swig_type_info _swigt__p_CBM__Compiler = {"_p_CBM__Compiler", "CBM::Compiler *", 0, 0, (void*)"CBM::Compiler", 0}; static swig_type_info _swigt__p_CBM__CompilerSelector = {"_p_CBM__CompilerSelector", "CBM::CompilerSelector *", 0, 0, (void*)"CBM::CompilerSelector", 0}; *************** *** 10324,10327 **** --- 10603,10607 ---- static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; + static swig_type_info _swigt__p_std__vectorTCBM__BenchmarkCached_p_t = {"_p_std__vectorTCBM__BenchmarkCached_p_t", "std::vector<CBM::BenchmarkCached * > *|CBM::BenchmarkVector *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorTstd__string_t = {"_p_std__vectorTstd__string_t", "std::vector<std::string > *|CBM::PackageVector *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_time_t = {"_p_time_t", "time_t *", 0, 0, (void*)0, 0}; *************** *** 10329,10332 **** --- 10609,10613 ---- static swig_type_info *swig_type_initial[] = { &_swigt__p_CBM__Benchmark, + &_swigt__p_CBM__BenchmarkCached, &_swigt__p_CBM__Compiler, &_swigt__p_CBM__CompilerSelector, *************** *** 10344,10347 **** --- 10625,10629 ---- &_swigt__p_char, &_swigt__p_std__string, + &_swigt__p_std__vectorTCBM__BenchmarkCached_p_t, &_swigt__p_std__vectorTstd__string_t, &_swigt__p_time_t, *************** *** 10349,10352 **** --- 10631,10635 ---- static swig_cast_info _swigc__p_CBM__Benchmark[] = { {&_swigt__p_CBM__Benchmark, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_CBM__BenchmarkCached[] = { {&_swigt__p_CBM__BenchmarkCached, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CBM__Compiler[] = { {&_swigt__p_CBM__Compiler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CBM__CompilerSelector[] = { {&_swigt__p_CBM__CompilerSelector, 0, 0, 0},{0, 0, 0, 0}}; *************** *** 10364,10367 **** --- 10647,10651 ---- static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; + static swig_cast_info _swigc__p_std__vectorTCBM__BenchmarkCached_p_t[] = { {&_swigt__p_std__vectorTCBM__BenchmarkCached_p_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorTstd__string_t[] = { {&_swigt__p_std__vectorTstd__string_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_time_t[] = { {&_swigt__p_time_t, 0, 0, 0},{0, 0, 0, 0}}; *************** *** 10369,10372 **** --- 10653,10657 ---- static swig_cast_info *swig_cast_initial[] = { _swigc__p_CBM__Benchmark, + _swigc__p_CBM__BenchmarkCached, _swigc__p_CBM__Compiler, _swigc__p_CBM__CompilerSelector, *************** *** 10384,10387 **** --- 10669,10673 ---- _swigc__p_char, _swigc__p_std__string, + _swigc__p_std__vectorTCBM__BenchmarkCached_p_t, _swigc__p_std__vectorTstd__string_t, _swigc__p_time_t, *************** *** 10409,10412 **** --- 10695,10705 ---- static swig_command_info swig_commands[] = { {"CBMc::setVerbosity", _wrap_setVerbosity}, + {"CBMc::BenchmarkCached_id_set", _wrap_BenchmarkCached_id_set}, + {"CBMc::BenchmarkCached_id_get", _wrap_BenchmarkCached_id_get}, + {"CBMc::BenchmarkCached_instance_set", _wrap_BenchmarkCached_instance_set}, + {"CBMc::BenchmarkCached_instance_get", _wrap_BenchmarkCached_instance_get}, + {"CBMc::new_BenchmarkCached", _wrap_new_BenchmarkCached}, + {"CBMc::delete_BenchmarkCached", _wrap_delete_BenchmarkCached}, + {"CBMc::Package_removeCached", _wrap_Package_removeCached}, {"CBMc::Package_hasPatch", _wrap_Package_hasPatch}, {"CBMc::Package_resetContext", _wrap_Package_resetContext}, *************** *** 10445,10450 **** --- 10738,10745 ---- {"CBMc::Package_Uninstall", _wrap_Package_Uninstall}, {"CBMc::Package_getStatus", _wrap_Package_getStatus}, + {"CBMc::Package_getStatusStr", _wrap_Package_getStatusStr}, {"CBMc::delete_Package", _wrap_delete_Package}, {"CBMc::Benchmark_Package", _wrap_Benchmark_Package}, + {"CBMc::Benchmark_setPlan", _wrap_Benchmark_setPlan}, {"CBMc::Benchmark_Name", _wrap_Benchmark_Name}, {"CBMc::Benchmark_Comments", _wrap_Benchmark_Comments}, *************** *** 10521,10527 **** {"CBMc::System_Split", _wrap_System_Split}, {"CBMc::System_Chomp", _wrap_System_Chomp}, - {"CBMc::System_display", _wrap_System_display}, {"CBMc::System_Program", _wrap_System_Program}, - {"CBMc::System_displayPrograms", _wrap_System_displayPrograms}, {"CBMc::System_exec", _wrap_System_exec}, {"CBMc::System_md5", _wrap_System_md5}, --- 10816,10820 ---- *************** *** 10539,10548 **** {"CBMc::System_getLastCommand", _wrap_System_getLastCommand}, {"CBMc::System_getLastCommandOutput", _wrap_System_getLastCommandOutput}, ! {"CBMc::Compiler_display", _wrap_Compiler_display}, {"CBMc::Compiler_compiler", _wrap_Compiler_compiler}, ! {"CBMc::Compiler_compilerName", _wrap_Compiler_compilerName}, ! {"CBMc::Compiler_compilerVersion", _wrap_Compiler_compilerVersion}, {"CBMc::Compiler_Binary", _wrap_Compiler_Binary}, ! {"CBMc::Compiler_language", _wrap_Compiler_language}, {"CBMc::delete_Compiler", _wrap_delete_Compiler}, {"CBMc::new_CompilerSelector", _wrap_new_CompilerSelector}, --- 10832,10841 ---- {"CBMc::System_getLastCommand", _wrap_System_getLastCommand}, {"CBMc::System_getLastCommandOutput", _wrap_System_getLastCommandOutput}, ! {"CBMc::Compiler_setPlan", _wrap_Compiler_setPlan}, {"CBMc::Compiler_compiler", _wrap_Compiler_compiler}, ! {"CBMc::Compiler_Name", _wrap_Compiler_Name}, ! {"CBMc::Compiler_Version", _wrap_Compiler_Version}, {"CBMc::Compiler_Binary", _wrap_Compiler_Binary}, ! {"CBMc::Compiler_Language", _wrap_Compiler_Language}, {"CBMc::delete_Compiler", _wrap_delete_Compiler}, {"CBMc::new_CompilerSelector", _wrap_new_CompilerSelector}, *************** *** 10863,10866 **** --- 11156,11160 ---- SvREADONLY_on(sv); } while(0) /*@SWIG@*/; + SWIG_TypeClientData(SWIGTYPE_p_CBM__BenchmarkCached, (void*) "CBM::BenchmarkCached"); /*@SWIG:%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "Package_Unknown", TRUE | 0x2); *************** *** 10964,10968 **** SWIG_TypeClientData(SWIGTYPE_p_CBM__CompilerSelector, (void*) "CBM::CompilerSelector"); /*@SWIG:%set_constant@*/ do { ! SV *sv = get_sv((char*) SWIG_prefix "CBM_PLAN", TRUE | 0x2); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(1))); SvREADONLY_on(sv); --- 11258,11262 ---- SWIG_TypeClientData(SWIGTYPE_p_CBM__CompilerSelector, (void*) "CBM::CompilerSelector"); /*@SWIG:%set_constant@*/ do { ! SV *sv = get_sv((char*) SWIG_prefix "H_CBM_PLAN", TRUE | 0x2); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(1))); SvREADONLY_on(sv); |
From: Frederic T. <xf...@us...> - 2007-02-15 19:02:58
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22629 Modified Files: System.cpp Log Message: Minor changes. Index: System.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/System.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** System.cpp 6 Feb 2007 19:36:45 -0000 1.6 --- System.cpp 15 Feb 2007 19:02:55 -0000 1.7 *************** *** 279,288 **** Package *System::Package(std::string pid) { ! CBM::cbmlib_internal *p = CBM::cbmlib_load((char*) pid.c_str()); if (p) ! return(p->PackageGet()); ! return(0); } --- 279,289 ---- Package *System::Package(std::string pid) { ! CBM::cbmlib_internal *p = CBM::cbmlib_load((char*) pid.c_str()); ! CBM::Package *result = 0; if (p) ! result=p->PackageGet(); ! return(result); } |
From: Frederic T. <xf...@us...> - 2007-02-15 19:02:41
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22615 Modified Files: System.h Log Message: CBM::Plan is defined for swig. Index: System.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/System.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** System.h 6 Feb 2007 19:36:45 -0000 1.6 --- System.h 15 Feb 2007 19:02:38 -0000 1.7 *************** *** 10,14 **** #define H_CBMSYSTEM ! #include <Plan/Plan.h> #include <vector> --- 10,25 ---- #define H_CBMSYSTEM ! #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 #include <vector> *************** *** 31,35 **** protected: class Config *configuration; ! CBM::Plan *plan; std::string configurationFile; --- 42,46 ---- protected: class Config *configuration; ! CBM_PLAN *plan; std::string configurationFile; *************** *** 92,96 **** virtual std::string Version(void); ! virtual CBM::Plan *Plan(void); /** Get used configuration. --- 103,107 ---- virtual std::string Version(void); ! virtual CBM_PLAN *Plan(void); /** Get used configuration. |
From: Frederic T. <xf...@us...> - 2007-02-15 19:01:41
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/perl/CBM In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22189 Modified Files: LibUI.pm Log Message: Interface to planned benchmarks and compilers. Hash defining standard compilers. Index: LibUI.pm =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/perl/CBM/LibUI.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LibUI.pm 30 Jan 2007 19:10:54 -0000 1.1 --- LibUI.pm 15 Feb 2007 19:01:36 -0000 1.2 *************** *** 18,21 **** --- 18,35 ---- use vars qw($VERSION @ISA @EXPORT_OK); + our %DEFAULT_COMPILERS = ('C' => + ['/usr/bin/gccx', + '/usr/bin/tcc', + 'gcc-2.95', 'gcc-2.96', + 'gcc-3.1', 'gcc-3.2', 'gcc-3.3', + 'gcc-3.4', 'gcc-4.0', 'gcc-4.1', + '/usr/local/bin/gcc', + '/usr/local/bin/tcc'], + 'C++' => + ['/usr/bin/g++', + 'g++-2.95', 'g++-2.96', + 'g++-3.1', 'g++-3.2', 'g++-3.3', + 'g++-3.4', 'g++-4.0', 'g++-4.1', + '/usr/local/bin/g++']); $VERSION="0.5.0"; *************** *** 130,133 **** --- 144,199 ---- } + sub plannedBenchmarks { + my $self = shift; + my $P = Plan(); + + my $n = $P->benchmarkNumber(); + my $i; + my @result; + + for($i=0; $i<$n; $i++) { + push(@result, $P->getBenchmark($i)); + } + return(@result); + } + + sub plannedBenchmark { + my $self = shift; + my $b = shift; + my $P = Plan(); + + my $n = $P->benchmarkNumber(); + my $i; + + for($i=0; $i<$n; $i++) { + if ($P->getBenchmark($i)->Name() eq $b->Name()) { + return(1); + } + } + + return(0); + } + + sub bytes { + my $self = shift; + my $remains = shift; + my $tot = 0; + + if ($remains>1024) { + $tot=$remains/1024.0; + $tot=sprintf("%0.2f", $tot); + if ($tot>1024.0) { + $tot=$tot/1024.0; + $tot=sprintf("%0.2f", $tot); + $tot.="Mb"; + } else { + $tot.="Kb"; + } + } else { + $tot="$remains" . "b"; + } + + return($tot); + } sub DESTROY { my $self = shift; |
From: Frederic T. <xf...@us...> - 2007-02-15 19:00:02
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/perl/CBM In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21411 Added Files: Makefile.am Log Message: First import. --- NEW FILE: Makefile.am --- # ----------------------------------------------------------------------------- # $Id: Makefile.am,v 1.1 2007/02/15 18:59:55 xfred Exp $ # $Source: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/perl/CBM/Makefile.am,v $ # # This is free software. # For details, see the GNU Public License in the COPYING file, or # Look http://www.fsf.org # ----------------------------------------------------------------------------- data_DATA = LibUI.pm datarootdir=@datarootdir@/compbenchmarks/@VERSION@/perl EXTRA_DIST = $(data_DATA) |
From: Frederic T. <xf...@us...> - 2007-02-15 18:59:25
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21358 Modified Files: Plan.cpp Plan.h Log Message: CBM::Benchmark is defined for swig. Index: Plan.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Plan.h 25 Jan 2007 22:08:46 -0000 1.4 --- Plan.h 15 Feb 2007 18:59:19 -0000 1.5 *************** *** 6,15 **** Look http://www.fsf.org ------------------------------------------------------------------------- */ ! #ifndef CBM_PLAN ! #define CBM_PLAN 1 #include <vector> #include <string> namespace CBM { /** \brief Configure and run benchmarks within specified contexts. --- 6,29 ---- Look http://www.fsf.org ------------------------------------------------------------------------- */ ! #ifndef H_CBM_PLAN ! #define H_CBM_PLAN 1 #include <vector> #include <string> + #ifdef SWIG + /* !!! If in SWIG parser, we need to define CBM::Benchmark so that all methods get + * correctly wrapped. Hope there's a better solution... */ + %module CBM + %{ + #include <Benchmark/Benchmark.h> + %} + #include <Benchmark/Benchmark.h> + #define CBM_BM CBM::Benchmark + + #else + # define CBM_BM class Benchmark + #endif + namespace CBM { /** \brief Configure and run benchmarks within specified contexts. *************** *** 53,57 **** virtual class Compiler* getCompiler(int _index); virtual std::string getCompilerOptions(int _index); ! virtual class Benchmark *getBenchmark(int _index); virtual int totalIterations(void); --- 67,71 ---- virtual class Compiler* getCompiler(int _index); virtual std::string getCompilerOptions(int _index); ! virtual CBM_BM *getBenchmark(int _index); virtual int totalIterations(void); Index: Plan.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Plan.cpp 6 Feb 2007 19:25:52 -0000 1.6 --- Plan.cpp 15 Feb 2007 18:59:19 -0000 1.7 *************** *** 73,76 **** --- 73,77 ---- CBM::XMLNode *N; CBM::XMLAttribute *A; + CBM::Benchmark *B; for(i=0; i<n; i++) { *************** *** 81,85 **** if (!A) continue; ! add(cbmSystem->Benchmark(A->Value())); } } --- 82,87 ---- if (!A) continue; ! B=cbmSystem->Benchmark(A->Value()); ! add(B); } } *************** *** 135,138 **** --- 137,141 ---- compilers.push_back(_compiler); + _compiler->setPlan(this, 0); stop(); return(1); *************** *** 156,159 **** --- 159,163 ---- } + _benchmark->setPlan(this, 0); benchmarks.push_back(_benchmark); stop(); *************** *** 172,175 **** --- 176,181 ---- if (C!=_compiler) ncompilers.push_back(C); + else + C->setPlan(0,0); } compilers=ncompilers; *************** *** 206,209 **** --- 212,217 ---- if (B!=_benchmark) nbenchmarks.push_back(B); + else + B->setPlan(0,0); } stop(); *************** *** 409,418 **** while ( (C=getCompiler(0)) != 0 ) { - remove(C); delete(C); } while ( (B=getBenchmark(0)) != 0 ) { - remove(B); delete(B); } --- 417,424 ---- *************** *** 440,444 **** XMLNode *CI; XMLAttribute *A; ! reset(); --- 446,452 ---- XMLNode *CI; XMLAttribute *A; ! ! if (!_planRootNode) ! return(0); reset(); *************** *** 454,457 **** --- 462,466 ---- if (!BM) return(0); + restoreBenchmarks(BM); *************** *** 459,462 **** --- 468,472 ---- if (!CO) return(0); + restoreCompilers(CO); *************** *** 464,467 **** --- 474,478 ---- if (!OP) return(0); + restoreOptions(OP); |
From: Frederic T. <xf...@us...> - 2007-02-15 18:58:14
|
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); } |
From: Frederic T. <xf...@us...> - 2007-02-15 18:57:33
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20546 Modified Files: Benchmark.cpp Benchmark.h Log Message: Unique instance for each benchmark. A plan can be (automatically) associated to a benchmark. Index: Benchmark.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Benchmark.h 5 Feb 2007 19:57:07 -0000 1.4 --- Benchmark.h 15 Feb 2007 18:57:30 -0000 1.5 *************** *** 15,18 **** --- 15,31 ---- #include <vector> + #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 System; *************** *** 35,38 **** --- 48,52 ---- protected: class Package *package; + CBM_PLAN *plan; /** Constructor * Initialise the Benchmark::system variable. */ *************** *** 54,60 **** public: ! /** Display informations about benchmark ! */ ! // void display(void); /** Benchmark name --- 68,72 ---- public: ! virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject); /** Benchmark name Index: Benchmark.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Benchmark.cpp 5 Feb 2007 19:58:55 -0000 1.4 --- Benchmark.cpp 15 Feb 2007 18:57:30 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- #include <Benchmark/Benchmark.h> #include <Benchmark/Package.h> + #include <Plan/Plan.h> #include <iostream> *************** *** 11,28 **** { package=_package; } /* ! void Benchmark::display(void) ! { std::cout << "benchmark::Name=" << Name() << std::endl ! << "benchmark::Package=" << Package()->Name() << std::endl ! << "benchmark::Language=" << Package()->language() << std::endl ! << "benchmark::Size=" << Package()->totalSize() << std::endl ! << "benchmark::Status=" << Package()->getStatus() << std::endl ! << "benchmark::Comments=" << Comments() << std::endl << std::endl; ! } */ std::string Benchmark::Name(void) { --- 12,38 ---- { package=_package; + plan=0; } /* ! void Benchmark::display(void) ! { std::cout << "benchmark::Name=" << Name() << std::endl ! << "benchmark::Package=" << Package()->Name() << std::endl ! << "benchmark::Language=" << Package()->language() << std::endl ! << "benchmark::Size=" << Package()->totalSize() << std::endl ! << "benchmark::Status=" << Package()->getStatus() << std::endl ! << "benchmark::Comments=" << Comments() << std::endl << std::endl; ! } */ + void Benchmark::setPlan(CBM::Plan *_plan, int modifyPlanObject) + { + if ((modifyPlanObject) && (plan)) + plan->remove(this); + + plan=_plan; + } + std::string Benchmark::Name(void) { *************** *** 93,95 **** --- 103,107 ---- Benchmark::~Benchmark() { + package->removeCached(this); + setPlan(0, 1); } |
From: Frederic T. <xf...@us...> - 2007-02-15 18:56:38
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20118 Modified Files: Package.cpp Package.h Log Message: Unique instance for each benchmark. Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Package.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Package.cpp 6 Feb 2007 19:41:24 -0000 1.9 --- Package.cpp 15 Feb 2007 18:56:29 -0000 1.10 *************** *** 48,57 **** { Benchmarks(); ! return(Benchmark(benchmarks[i])); } CBM::Benchmark *Package::Benchmark(std::string bid) { ! std::cerr << "virtual Package::Benchmark() called" << std::endl; return(0); } --- 48,57 ---- { Benchmarks(); ! return(Benchmark(benchmarks[i]->id)); } CBM::Benchmark *Package::Benchmark(std::string bid) { ! std::cerr << "Package::Benchmark : virtual method called." << std::endl; return(0); } *************** *** 99,102 **** --- 99,115 ---- } + void Package::removeCached(CBM::Benchmark *_benchmark) + { + int i; + int n = benchmarkNumber(); + CBM::BenchmarkCached *BC; + + for(i=0; i<n; i++) { + BC=benchmarks[i]; + if (BC->instance==_benchmark) + BC->instance=0; + } + } + int Package::hasPatch(void) { *************** *** 616,620 **** Package::~Package() { ! std::vector<Package*>::iterator it; if (PACKAGE_AUTOPURGE) { --- 629,642 ---- Package::~Package() { ! std::vector<BenchmarkCached*>::iterator itb; ! std::vector<Package*>::iterator it; ! ! ! for(itb=benchmarks.begin(); itb!=benchmarks.end();) { ! if ((*itb)->instance) ! delete((*itb)->instance); ! delete(*itb); ! benchmarks.erase(itb); ! } if (PACKAGE_AUTOPURGE) { Index: Package.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Package.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Package.h 6 Feb 2007 17:54:02 -0000 1.5 --- Package.h 15 Feb 2007 18:56:29 -0000 1.6 *************** *** 33,40 **** class System; /** Defines a vector of benchmarks. Basically owned by CBM::Package instance. */ ! typedef std::vector<std::string> BenchmarkVector; /** \brief Defines an abstract package. --- 33,50 ---- class System; + /** Defines package's representation of a benchmark + * Cache every instance of a given benchmark so allowing that when + * Benchmark(std::string) or Benchmark(int) are called, the + * previously created instance, if exists is returned. + * \sa BenchmarkVector */ + typedef struct { + std::string id; + CBM_BM *instance; + } BenchmarkCached; + /** Defines a vector of benchmarks. Basically owned by CBM::Package instance. */ ! typedef std::vector<BenchmarkCached*> BenchmarkVector; /** \brief Defines an abstract package. *************** *** 175,178 **** --- 185,191 ---- CompilerOptions *_currentOptions); public: + + virtual void removeCached(CBM_BM *_benchmark); + /** Indicates if the package needs patching * Must be overloaded if so. Returns 0 by default. |