Merge branch 'master' into gsoc2017-php7-classes-via-c-api

This commit is contained in:
Olly Betts 2017-09-14 09:01:37 +12:00
commit f72d9c1f21
103 changed files with 2332 additions and 853 deletions

View file

@ -990,7 +990,7 @@ private:
* overname: The overload string for overloaded function.
* wname: The SWIG wrapped name--the name of the C function.
* base: A list of the names of base classes, in the case where this
* is is a vritual method not defined in the current class.
* is a virtual method not defined in the current class.
* parms: The parameters.
* result: The result type.
* is_static: Whether this is a static method or member.

View file

@ -1949,7 +1949,7 @@ int Language::unrollVirtualMethods(Node *n, Node *parent, List *vm, int default_
generation of 'empty' director classes.
But this has to be done outside the previous 'for'
an the recursive loop!.
and the recursive loop!.
*/
if (n == parent) {
int len = Len(vm);
@ -2078,7 +2078,7 @@ int Language::classDirectorConstructors(Node *n) {
needed, since there is a public constructor already defined.
(scottm) This code is needed here to make the director_abstract +
test generate compilable code (Example2 in director_abastract.i).
test generate compilable code (Example2 in director_abstract.i).
(mmatus) This is very strange, since swig compiled with gcc3.2.3
doesn't need it here....
@ -3308,7 +3308,7 @@ Node *Language::classLookup(const SwigType *s) const {
}
if (n) {
/* Found a match. Look at the prefix. We only allow
the cases where where we want a proxy class for the particular type */
the cases where we want a proxy class for the particular type */
bool acceptable_prefix =
(Len(prefix) == 0) || // simple type (pass by value)
(Strcmp(prefix, "p.") == 0) || // pointer

View file

@ -1755,7 +1755,7 @@ public:
*
* This is to convert the string of Lua code into a proper string, which can then be
* emitted into the C/C++ code.
* Basically is is a lot of search & replacing of odd sequences
* Basically it is a lot of search & replacing of odd sequences
* ---------------------------------------------------------------------------- */
void escapeCode(String *str) {
@ -1770,7 +1770,7 @@ public:
/* -----------------------------------------------------------------------------
* rawGetCArraysHash(String *name)
*
* A small helper to hide impelementation of how CArrays hashes are stored
* A small helper to hide implementation of how CArrays hashes are stored
* ---------------------------------------------------------------------------- */
Hash *rawGetCArraysHash(const_String_or_char_ptr name) {

View file

@ -718,7 +718,7 @@ String * R::createFunctionPointerHandler(SwigType *t, Node *n, int *numArgs) {
function that handles the scoerceout.
We need to check if any of the argument types have an entry in
that map. If none do, the ignore and call the function straight.
Otherwise, generate the a marshalling function.
Otherwise, generate a marshalling function.
Need to be able to find it in S. Or use an entirely generic one
that evaluates the expressions.
Handle errors in the evaluation of the function by restoring

View file

@ -187,8 +187,10 @@ class TypePass:private Dispatcher {
ilist = alist = NewList();
Append(ilist, bcls);
} else {
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Base class '%s' has no name as it is an empty template instantiated with '%%template()'. Ignored.\n", SwigType_namestr(bname));
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bcls), Getline(bcls), "The %%template directive must be written before '%s' is used as a base class and be declared with a name.\n", SwigType_namestr(bname));
if (!GetFlag(bcls, "feature:ignore")) {
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Base class '%s' has no name as it is an empty template instantiated with '%%template()'. Ignored.\n", SwigType_namestr(bname));
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bcls), Getline(bcls), "The %%template directive must be written before '%s' is used as a base class and be declared with a name.\n", SwigType_namestr(bname));
}
}
}
break;
@ -209,8 +211,10 @@ class TypePass:private Dispatcher {
ilist = alist = NewList();
Append(ilist, bcls);
} else {
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Base class '%s' has no name as it is an empty template instantiated with '%%template()'. Ignored.\n", SwigType_namestr(bname));
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bcls), Getline(bcls), "The %%template directive must be written before '%s' is used as a base class and be declared with a name.\n", SwigType_namestr(bname));
if (!GetFlag(bcls, "feature:ignore")) {
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Base class '%s' has no name as it is an empty template instantiated with '%%template()'. Ignored.\n", SwigType_namestr(bname));
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bcls), Getline(bcls), "The %%template directive must be written before '%s' is used as a base class and be declared with a name.\n", SwigType_namestr(bname));
}
}
} else {
Swig_warning(WARN_TYPE_UNDEFINED_CLASS, Getfile(bname), Getline(bname), "Base class '%s' undefined.\n", SwigType_namestr(bname));
@ -1199,10 +1203,7 @@ class TypePass:private Dispatcher {
} else if (Strcmp(ntype, "enum") == 0) {
SwigType_typedef_using(Getattr(n, "uname"));
} else if (Strcmp(ntype, "template") == 0) {
/*
Printf(stdout, "usingDeclaration template %s --- %s\n", Getattr(n, "name"), Getattr(n, "uname"));
SwigType_typedef_using(Getattr(n, "uname"));
*/
}
}
}

View file

@ -59,7 +59,7 @@ int is_non_virtual_protected_access(Node *n) {
// When vtable is empty, the director class does not get emitted, so a check for an empty vtable should be done.
// However, vtable is set in Language and so is not yet set when methods in Typepass call clean_overloaded()
// which calls is_non_virtual_protected_access. So commented out below.
// Moving the director vtable creation into into Typepass should solve this problem.
// Moving the director vtable creation into Typepass should solve this problem.
if (is_member_director_helper(parentNode, n) /* && Getattr(parentNode, "vtable")*/)
result = 1;
}