Commits

wlav committed 1e368b3

- add fix to genreflex patch to allow proper code generation for inner union
- more hsimple bench mark fixes

Comments (0)

Files changed (5)

pypy/module/cppyy/bench/Makefile

 endif
 
 
-bench02Dict_reflex.so: bench02.h bench02.xml
+bench02Dict_reflex.so: bench02.h bench02.cxx bench02.xml
 	$(genreflex) bench02.h $(genreflexflags) --selection=bench02.xml -I$(ROOTSYS)/include
 	g++ -o $@ bench02.cxx bench02_rflx.cpp -I$(ROOTSYS)/include -shared -lReflex -lHistPainter `root-config --libs` $(cppflags) $(cppflags2)

pypy/module/cppyy/bench/bench02.cxx

 
 #include <iostream>
 
+TClass *TClass::GetClass(const char*, Bool_t, Bool_t) {
+   static TClass dummy("dummy");
+   return &dummy;
+}
 
 class TTestApplication : public TApplication {
 public:
     if (!gApplication) {
         int argc = 1;
         char* argv[1]; argv[0] = (char*)appname;
-        gApplication = new TTestApplication(appname, &argc, argv, kTRUE);
+        gApplication = new TTestApplication(appname, &argc, argv, kFALSE);
     }
 }
 

pypy/module/cppyy/bench/bench02.h

 #include "TBasket.h"
 #include "TBox.h"
 #include "TBranchRef.h"
+#include "TBrowser.h"
 #include "TClassGenerator.h"
 #include "TClassRef.h"
 #include "TClassStreamer.h"

pypy/module/cppyy/bench/bench02.xml

      <!-- ROOT classes -->
      <class pattern="T[A-Z]*" />
      <class pattern="ROOT::T[A-Z]*" />
+     <class pattern="ROOT::Fit::*" />
 
      <!-- STL classes actually used -->
+     <class name="std::string" />
      <class name="std::ostream" />
      <class name="std::type_info" />
-     <class pattern="std::_Vector_base<*> >" />
+     <class pattern="std::vector<*>" />
+     <class pattern="std::_Vector_base<*>" />
 
      <!-- helper -->
      <class name="Bench02RootApp" />
 
   <exclusion>
 
+     <struct pattern="TString::*" />
      <class name="TString" >
          <field name="fRep" transient="true"/>
      </class>
 
      <class name="TUUID::uuid_time_t" />
 
-     <class pattern="TString::*" />
-     <class name="TString::Rep_t" />
-
      <class name="TClass::TNameMapNode" />
      <class name="TFileOpenHandle" />
 

pypy/module/cppyy/genreflex-methptrgetter.patch

 Index: cint/reflex/python/genreflex/gendict.py
 ===================================================================
---- cint/reflex/python/genreflex/gendict.py	(revision 40173)
+--- cint/reflex/python/genreflex/gendict.py	(revision 40448)
 +++ cint/reflex/python/genreflex/gendict.py	(working copy)
 @@ -52,6 +52,7 @@
      self.typedefs_for_usr = []
      # The next is to avoid a known problem with gccxml that it generates a
      # references to id equal '_0' which is not defined anywhere
      self.xref['_0'] = {'elem':'Unknown', 'attrs':{'id':'_0','name':''}, 'subelems':[]}
-@@ -1956,8 +1957,15 @@
+@@ -1281,6 +1282,8 @@
+     bases = self.getBases( attrs['id'] )
+     if inner and attrs.has_key('demangled') and self.isUnnamedType(attrs['demangled']) :
+       cls = attrs['demangled']
++      if self.xref[attrs['id']]['elem'] == 'Union':
++         return 80*' '
+       clt = ''
+     else:
+       cls = self.genTypeName(attrs['id'],const=True,colon=True)
+@@ -1318,7 +1321,7 @@
+       # Inner class/struct/union/enum.
+       for m in memList :
+         member = self.xref[m]
+-        if member['elem'] in ('Class','Struct','Union','Enumeration') \
++        if member['elem'] in ('Class','Struct','Enumeration') \
+            and member['attrs'].get('access') in ('private','protected') \
+            and not self.isUnnamedType(member['attrs'].get('demangled')):
+           cmem = self.genTypeName(member['attrs']['id'],const=True,colon=True)
+@@ -1956,8 +1959,15 @@
      else    : params  = '0'
      s = '  .AddFunctionMember(%s, Reflex::Literal("%s"), %s%s, 0, %s, %s)' % (self.genTypeID(id), name, type, id, params, mod)
      s += self.genCommentProperty(attrs)
    def genMCODef(self, type, name, attrs, args):
      id       = attrs['id']
      cl       = self.genTypeName(attrs['context'],colon=True)
-@@ -2024,8 +2032,44 @@
+@@ -2024,8 +2034,44 @@
            if returns == 'void' : body += '  }\n'
            else :                 body += '  }\n'
      body += '}\n'
      for a in args :
 Index: cint/reflex/python/genreflex/genreflex.py
 ===================================================================
---- cint/reflex/python/genreflex/genreflex.py	(revision 40173)
+--- cint/reflex/python/genreflex/genreflex.py	(revision 40448)
 +++ cint/reflex/python/genreflex/genreflex.py	(working copy)
 @@ -108,6 +108,10 @@
           Print extra debug information while processing. Keep intermediate files\n