From: Marcelo M. <mar...@us...> - 2005-12-08 21:30:18
|
Update of /cvsroot/swig/SWIG/Source/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv818/Source/Modules Modified Files: main.cxx overload.cxx Log Message: 'oficially' add fastdispatch option Index: main.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/main.cxx,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** main.cxx 8 Dec 2005 08:54:05 -0000 1.66 --- main.cxx 8 Dec 2005 21:30:06 -0000 1.67 *************** *** 60,64 **** if not explicit value is given to the feature, a '1' is used \n\ -fvirtual - Compile in virtual elimination mode\n\ ! -fdispatch - Use fast dispatch mode, which produces faster overload dispatcher code\n\ -Fstandard - Display error/warning messages in commonly used format\n\ -Fmicrosoft - Display error/warning messages in Microsoft format\n\ --- 60,65 ---- if not explicit value is given to the feature, a '1' is used \n\ -fvirtual - Compile in virtual elimination mode\n\ ! -fastdispatch - Enable fast dispatch mode, which produces faster overload dispatcher code\n\ ! -nofastdispatch - Disable fast dispatch mode (default)\n\ -Fstandard - Display error/warning messages in commonly used format\n\ -Fmicrosoft - Display error/warning messages in Microsoft format\n\ *************** *** 390,396 **** Wrapper_virtual_elimination_mode_set(1); Swig_mark_arg(i); ! } else if (strcmp(argv[i],"-fdispatch") == 0) { Wrapper_fast_dispatch_mode_set(1); Swig_mark_arg(i); } else if (strcmp(argv[i],"-directors") == 0) { Hash *features_hash = Swig_cparse_features(); --- 391,400 ---- Wrapper_virtual_elimination_mode_set(1); Swig_mark_arg(i); ! } else if (strcmp(argv[i],"-fastdispatch") == 0) { Wrapper_fast_dispatch_mode_set(1); Swig_mark_arg(i); + } else if (strcmp(argv[i],"-nofastdispatch") == 0) { + Wrapper_fast_dispatch_mode_set(0); + Swig_mark_arg(i); } else if (strcmp(argv[i],"-directors") == 0) { Hash *features_hash = Swig_cparse_features(); Index: overload.cxx =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Modules/overload.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** overload.cxx 8 Dec 2005 08:54:05 -0000 1.13 --- overload.cxx 8 Dec 2005 21:30:06 -0000 1.14 *************** *** 373,376 **** --- 373,377 ---- for (i = 0; i < nfunc; i++) { + int fn = 0; Node *ni = Getitem(dispatch,i); Parm *pi = Getattr(ni,"wrap:parms"); *************** *** 411,416 **** bool test=(Len(coll)>0 && num_arguments); if (test) { ! Printf(f,"int _v=1;\n"); ! j = 0; Parm *pj = pi; --- 412,416 ---- bool test=(Len(coll)>0 && num_arguments); if (test) { ! int need_v = 1; j = 0; Parm *pj = pi; *************** *** 460,463 **** --- 460,467 ---- if (emitcheck) { + if (need_v) { + Printf(f,"int _v = 1;\n"); + need_v = 0; + } if (j >= num_required) { Printf(f, "if (%s > %d) {\n", argc_template_string, j); *************** *** 467,471 **** Replaceall(tm,"$input", tmp); Printv(f,"{\n",tm,"}\n",NIL); ! Printf(f, "if (!_v) goto fail_%s;\n", Getattr(ni, "wrap:name")); } } --- 471,476 ---- Replaceall(tm,"$input", tmp); Printv(f,"{\n",tm,"}\n",NIL); ! fn = i + 1; ! Printf(f, "if (!_v) goto check_%d;\n", fn); } } *************** *** 492,496 **** Printf(f,"}\n"); /* braces closes "if" for this method */ ! Printf(f, "fail_%s:\n\n", Getattr(ni,"wrap:name")); Delete (lfmt); --- 497,501 ---- Printf(f,"}\n"); /* braces closes "if" for this method */ ! if (fn) Printf(f, "check_%d:\n\n", fn); Delete (lfmt); |