Use the code written for -fvirtual to gather information about virtual methods needed for C#.
The code written for -fvirtual is largely replicated in the code for directors and ought to be consolidated; they both are constructing vtables of sorts.
Both approaches also need fixing for when the virtual keyword is not used, eg
class Base {
virtual void foo();
virtual void bar();
};
class Derived : public Base {
virtual void foo();
void bar();
};
Neither currently detects bar as a virtual method.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4525 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5e04ac087a
commit
17c8b86ba9
1 changed files with 7 additions and 5 deletions
|
|
@ -91,8 +91,10 @@ class Allocate : public Dispatcher {
|
|||
(checkAttribute(temp, "name", name)) &&
|
||||
(checkAttribute(temp, "type", type)) &&
|
||||
(!Strcmp(local_decl, base_decl)) ) {
|
||||
Setattr(c, "Tiger: defined_in_base", "1");
|
||||
Setattr(c, "feature:ignore", "1");
|
||||
// Indicate a virtual method in the derived class, that is, not the virtual method definition in a base class
|
||||
Setattr(c, "virtual:derived", "1");
|
||||
if (virtual_elimination_mode)
|
||||
Setattr(c, "feature:ignore", "1");
|
||||
Delete(base_decl);
|
||||
Delete(local_decl);
|
||||
return 1;
|
||||
|
|
@ -111,6 +113,7 @@ class Allocate : public Dispatcher {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// function not used
|
||||
/* Checks if a class has the same virtual functions as the bases have */
|
||||
int class_is_defined_in_bases(Node *n) {
|
||||
Node *c, *bases; /* bases is the closest ancestors of class n */
|
||||
|
|
@ -470,9 +473,8 @@ public:
|
|||
|
||||
if (inclass) {
|
||||
/* check whether the member node n is defined in class node inclass's bases */
|
||||
if (virtual_elimination_mode)
|
||||
if (checkAttribute(n, "storage", "virtual"))
|
||||
class_member_is_defined_in_bases(n, inclass);
|
||||
if (checkAttribute(n, "storage", "virtual"))
|
||||
class_member_is_defined_in_bases(n, inclass);
|
||||
|
||||
String *name = Getattr(n,"name");
|
||||
if (cplus_mode != PUBLIC) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue