Remove unused code from PHP backend

These are leftovers from the work on wrapping using only PHP's C API.
This commit is contained in:
Olly Betts 2021-12-13 08:53:23 +13:00
commit bf68b377e6

View file

@ -494,7 +494,6 @@ public:
* things are being called in the wrong order
*/
// Printv(s_init,s_resourcetypes,NIL);
Printf(s_oinit, " /* end oinit subsection */\n");
Printf(s_init, "%s\n", s_oinit);
@ -831,31 +830,6 @@ public:
* functionWrapper()
* ------------------------------------------------------------ */
/* Helper method for PHP::functionWrapper */
bool is_class(SwigType *t) {
Node *n = classLookup(t);
if (n) {
String *r = Getattr(n, "php:proxy"); // Set by classDeclaration()
if (!r)
r = Getattr(n, "sym:name"); // Not seen by classDeclaration yet, but this is the name
if (r)
return true;
}
return false;
}
/* Helper method for PHP::functionWrapper to get class name for parameter*/
String *get_class_name(SwigType *t) {
Node *n = classLookup(t);
String *r = NULL;
if (n) {
r = Getattr(n, "php:proxy"); // Set by classDeclaration()
if (!r)
r = Getattr(n, "sym:name"); // Not seen by classDeclaration yet, but this is the name
}
return r;
}
/* Helper function to check if class is wrapped */
bool is_class_wrapped(String *className) {
if (!className)
@ -864,18 +838,6 @@ public:
return n && Getattr(n, "classtype") != NULL;
}
/* Is special return type */
bool is_param_type_pointer(SwigType *t) {
if (SwigType_ispointer(t) ||
SwigType_ismemberpointer(t) ||
SwigType_isreference(t) ||
SwigType_isarray(t))
return true;
return false;
}
void generate_magic_property_methods(Node *class_node, String *base_class) {
if (Equal(base_class, "Exception") || !is_class_wrapped(base_class)) {
base_class = NULL;
@ -1254,7 +1216,6 @@ public:
String *source;
/* Skip ignored arguments */
//while (Getattr(p,"tmap:ignore")) { p = Getattr(p,"tmap:ignore:next");}
while (checkAttribute(p, "tmap:in:numinputs", "0")) {
p = Getattr(p, "tmap:in:next");
}
@ -1268,14 +1229,6 @@ public:
Printf(f->code, "\tif(arg_count > %d) {\n", i);
}
String *paramType_class = NULL;
bool paramType_valid = is_class(pt);
if (paramType_valid) {
paramType_class = get_class_name(pt);
Chop(paramType_class);
}
if ((tm = Getattr(p, "tmap:in"))) {
Replaceall(tm, "$input", source);
Setattr(p, "emit:input", source);