Skip to content

Commit

Permalink
Change methodclass to getCurrentClass
Browse files Browse the repository at this point in the history
  • Loading branch information
ng420 committed Aug 4, 2016
1 parent 8d127d3 commit 7ee51b2
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions Source/Modules/hhvm.cxx
Expand Up @@ -362,20 +362,20 @@ class HHVM : public Language {

Printf(f_phpcode, "<<__Native>>\n");
if (is_constructor){
wclassname = GetChar(Swig_methodclass(n), "wrap:name");
classname = GetChar(Swig_methodclass(n), "sym:name");
wclassname = GetChar(getCurrentClass(), "wrap:name");
classname = GetChar(getCurrentClass(), "sym:name");
Printf(f_register, " HHVM_MALIAS(%s, __construct, %s, __construct);\n", classname, wclassname);
Printf(f_link, "HHVM_METHOD(%s, __construct", wclassname);
Printf(f_phpcode, "function __construct(");
} else if (is_destructor) {
wclassname = GetChar(Swig_methodclass(n), "wrap:name");
classname = GetChar(Swig_methodclass(n), "sym:name");
wclassname = GetChar(getCurrentClass(), "wrap:name");
classname = GetChar(getCurrentClass(), "sym:name");
Printf(f_register, " HHVM_MALIAS(%s, __destruct, %s, __destruct);\n", classname, wclassname);
Printf(f_link, "HHVM_METHOD(%s, __destruct", wclassname);
Printf(f_phpcode, "function __destruct(");
} else if (staticmethodwrapper || is_static) {
wclassname = GetChar(Swig_methodclass(n), "wrap:name");
classname = GetChar(Swig_methodclass(n), "sym:name");
wclassname = GetChar(getCurrentClass(), "wrap:name");
classname = GetChar(getCurrentClass(), "sym:name");
if (staticmethodwrapper)
methodname = Char(Getattr(n, "staticmemberfunctionHandler:sym:name"));
else
Expand All @@ -384,8 +384,8 @@ class HHVM : public Language {
Printf(f_link, "HHVM_STATIC_METHOD(%s, %s", wclassname, methodname);
Printf(f_phpcode, "static %s function %s(", acc, methodname);
} else if (is_member) {
wclassname = GetChar(Swig_methodclass(n), "wrap:name");
classname = GetChar(Swig_methodclass(n), "sym:name");
wclassname = GetChar(getCurrentClass(), "wrap:name");
classname = GetChar(getCurrentClass(), "sym:name");
if (Getattr(n, "memberfunctionHandler:sym:name")) {
methodname = Getattr(n, "memberfunctionHandler:sym:name");
} else {
Expand Down Expand Up @@ -467,10 +467,10 @@ class HHVM : public Language {
Printf(f_link, "%s(%s);\n", wname, call_parms);
} else if (is_constructor) {
Printf(f_link, " auto new_obj = %s(%s);\n", wname, call_parms);
String *wclassname = GetChar(Swig_methodclass(n), "wrap:name");
String *wclassname = GetChar(getCurrentClass(), "wrap:name");
Printf(f_link, " Native::data<%s>(this_)->_obj_ptr = Native::data<%s>(new_obj.toObject())->_obj_ptr;\n", wclassname, wclassname);
} else if(is_destructor) {
String *wclassname = GetChar(Swig_methodclass(n), "wrap:name");
String *wclassname = GetChar(getCurrentClass(), "wrap:name");
Printf(f_link, " if (!Native::data<%s>(this_)->isRef)\n", wclassname);
Printf(f_link, " %s(%s);\n", wname, call_parms);
Printf(f_link, " Native::data<%s>(this_)->_obj_ptr = nullptr;\n", wclassname);
Expand Down Expand Up @@ -967,16 +967,11 @@ class HHVM : public Language {
* ------------------------------------------------------------ */

virtual int memberconstantHandler(Node *n) {
String *wclassname = GetChar(Swig_methodclass(n), "wrap:name");
String *wclassname = GetChar(getCurrentClass(), "wrap:name");
String *name = GetChar(n, "name");
String *rawval = Getattr(n, "rawval");
String *value = rawval ? rawval : Getattr(n, "value");
String *tm;
bool is_enum = (Cmp(Getattr(n, "nodeType"), "enumitem") == 0);

if (is_enum) {
wclassname = GetChar(parentNode(Swig_methodclass(n)), "wrap:name");
}

if ((tm = Swig_typemap_lookup("consttab", n, name, 0))) {
if (Strcmp(tm, "KindOfPersistentString") == 0) {
Expand Down

0 comments on commit 7ee51b2

Please sign in to comment.