Discussion:
[Swig-devel] Documentation for SWIG attribute namespaces
Andrew Parker
2015-11-03 09:38:22 UTC
Permalink
Is there any detailed documentation on this? I'm trying to decypher the
tree but it's pretty hard to guess what a lot of things are for without
looking at the source.

For example, if I defined a trivial struct in the input file two different
ways:

struct my_struct
{};

vs

struct my_struct
{
my_struct();
~my_struct();
};

Then I can see that the class node corresponding to this changes from (I've
ignored attributes which aren't relevant to ctrs/dtrs):

| allocate:default_constructor - "1"
| allocate:default_destructor - "1"
| has_constructor - "1"
| has_destructor - "1"
| allocate:copy_constructor - "1"

| has_default_constructor - "1"
| allocate:destructor - "1"

to

| allocate:default_constructor - "1"
| allocate:default_destructor - "1"
| has_constructor - "1"
| has_destructor - "1"
| allocate:copy_constructor - "1"

| allocate:has_constructor - "1"
| allocate:public_constructor - "1"
| allocate:has_destructor - "1"

This doesn't seem to be in any way consistent. Am I missing something?

FYI I'm looking at adapting and extending SWIG for some internal tooling so
being able to decypher the whole tree is vital.

Thanks
William S Fulton
2015-11-25 19:58:56 UTC
Permalink
Hi Andrew

Sorry, there isn't any formal documentation on the attributes. The code is
the best reference. I agree that it looks inconsistent and I'm not entirely
happy with the handling of implicit default constructors/destructors isn't.
A lot of this is done in the Language class, when I think it ought to all
be done during the allocate phase. Patches to tidy up are welcome,
particularly if it fixes some bugs. I think there may be some corner case
bugs in this area and the related =default and =delete explicity defaulted
functions aren't particularly well supported.

William
Post by Andrew Parker
Is there any detailed documentation on this? I'm trying to decypher the
tree but it's pretty hard to guess what a lot of things are for without
looking at the source.
For example, if I defined a trivial struct in the input file two different
struct my_struct
{};
vs
struct my_struct
{
my_struct();
~my_struct();
};
Then I can see that the class node corresponding to this changes from
| allocate:default_constructor - "1"
| allocate:default_destructor - "1"
| has_constructor - "1"
| has_destructor - "1"
| allocate:copy_constructor - "1"
| has_default_constructor - "1"
| allocate:destructor - "1"
to
| allocate:default_constructor - "1"
| allocate:default_destructor - "1"
| has_constructor - "1"
| has_destructor - "1"
| allocate:copy_constructor - "1"
| allocate:has_constructor - "1"
| allocate:public_constructor - "1"
| allocate:has_destructor - "1"
This doesn't seem to be in any way consistent. Am I missing something?
FYI I'm looking at adapting and extending SWIG for some internal tooling
so being able to decypher the whole tree is vital.
Thanks
------------------------------------------------------------------------------
_______________________________________________
Swig-devel mailing list
https://lists.sourceforge.net/lists/listinfo/swig-devel
Andrew Parker
2015-11-28 03:29:33 UTC
Permalink
Thanks for the info William!

Andrew
Post by William S Fulton
Hi Andrew
Sorry, there isn't any formal documentation on the attributes. The code is
the best reference. I agree that it looks inconsistent and I'm not entirely
happy with the handling of implicit default constructors/destructors isn't.
A lot of this is done in the Language class, when I think it ought to all
be done during the allocate phase. Patches to tidy up are welcome,
particularly if it fixes some bugs. I think there may be some corner case
bugs in this area and the related =default and =delete explicity defaulted
functions aren't particularly well supported.
William
Post by Andrew Parker
Is there any detailed documentation on this? I'm trying to decypher the
tree but it's pretty hard to guess what a lot of things are for without
looking at the source.
For example, if I defined a trivial struct in the input file two
struct my_struct
{};
vs
struct my_struct
{
my_struct();
~my_struct();
};
Then I can see that the class node corresponding to this changes from
| allocate:default_constructor - "1"
| allocate:default_destructor - "1"
| has_constructor - "1"
| has_destructor - "1"
| allocate:copy_constructor - "1"
| has_default_constructor - "1"
| allocate:destructor - "1"
to
| allocate:default_constructor - "1"
| allocate:default_destructor - "1"
| has_constructor - "1"
| has_destructor - "1"
| allocate:copy_constructor - "1"
| allocate:has_constructor - "1"
| allocate:public_constructor - "1"
| allocate:has_destructor - "1"
This doesn't seem to be in any way consistent. Am I missing something?
FYI I'm looking at adapting and extending SWIG for some internal tooling
so being able to decypher the whole tree is vital.
Thanks
------------------------------------------------------------------------------
_______________________________________________
Swig-devel mailing list
https://lists.sourceforge.net/lists/listinfo/swig-devel
Loading...