aboutsummaryrefslogtreecommitdiff
path: root/Source/Swig
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2012-11-13 22:16:28 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2012-11-13 22:16:28 +0000
commit421139a5feb500e6d74a457801df55a67fe96802 (patch)
treed498010779259d9ca6cf39cfb4c933c780fefa21 /Source/Swig
parent0ca11c8b6fce3d974a53b2e4aa86b84157ff0ef5 (diff)
downloadswig-421139a5feb500e6d74a457801df55a67fe96802.tar.gz
Fix some subtle named output typemap lookup misses, the fully qualified name was not always being in all cases such as member variables
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13878 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source/Swig')
-rw-r--r--Source/Swig/parms.c22
-rw-r--r--Source/Swig/swigparm.h3
-rw-r--r--Source/Swig/typemap.c10
3 files changed, 30 insertions, 5 deletions
diff --git a/Source/Swig/parms.c b/Source/Swig/parms.c
index 283a2f5c2..0f4d17b73 100644
--- a/Source/Swig/parms.c
+++ b/Source/Swig/parms.c
@@ -19,13 +19,13 @@ char cvsroot_parms_c[] = "$Id$";
* NewParm()
*
* Create a new parameter from datatype 'type' and name 'name' copying
- * the file and line number from the Node file_line_node.
+ * the file and line number from the Node from_node.
* ------------------------------------------------------------------------ */
-Parm *NewParm(SwigType *type, const_String_or_char_ptr name, Node *file_line_node) {
+Parm *NewParm(SwigType *type, const_String_or_char_ptr name, Node *from_node) {
Parm *p = NewParmWithoutFileLineInfo(type, name);
- Setfile(p, Getfile(file_line_node));
- Setline(p, Getline(file_line_node));
+ Setfile(p, Getfile(from_node));
+ Setline(p, Getline(from_node));
return p;
}
@@ -49,6 +49,20 @@ Parm *NewParmWithoutFileLineInfo(SwigType *type, const_String_or_char_ptr name)
}
/* ------------------------------------------------------------------------
+ * NewParmNode()
+ *
+ * Create a new parameter from datatype 'type' and name and symbol table as
+ * well as file and line number from the 'from_node'.
+ * The resulting Parm will be similar to a Node used for typemap lookups.
+ * ------------------------------------------------------------------------ */
+
+Parm *NewParmNode(SwigType *type, Node *from_node) {
+ Parm *p = NewParm(type, Getattr(from_node, "name"), from_node);
+ Setattr(p, "sym:symtab", Getattr(from_node, "sym:symtab"));
+ return p;
+}
+
+/* ------------------------------------------------------------------------
* CopyParm()
* ------------------------------------------------------------------------ */
diff --git a/Source/Swig/swigparm.h b/Source/Swig/swigparm.h
index 70a39390e..368b4d26b 100644
--- a/Source/Swig/swigparm.h
+++ b/Source/Swig/swigparm.h
@@ -13,8 +13,9 @@
* ----------------------------------------------------------------------------- */
/* Individual parameters */
-extern Parm *NewParm(SwigType *type, const_String_or_char_ptr name, Node *file_line_node);
+extern Parm *NewParm(SwigType *type, const_String_or_char_ptr name, Node *from_node);
extern Parm *NewParmWithoutFileLineInfo(SwigType *type, const_String_or_char_ptr name);
+extern Parm *NewParmNode(SwigType *type, Node *from_node);
extern Parm *CopyParm(Parm *p);
/* Parameter lists */
diff --git a/Source/Swig/typemap.c b/Source/Swig/typemap.c
index 0488b1b62..fc7728084 100644
--- a/Source/Swig/typemap.c
+++ b/Source/Swig/typemap.c
@@ -1339,7 +1339,17 @@ static String *Swig_typemap_lookup_impl(const_String_or_char_ptr tmap_method, No
pname = Getattr(node, "name");
+/*
+ if (pname && node && Getattr(node, "sym:symtab")) {
+ if (!checkAttribute(node, "kind", "function")) {
+ Printf(stdout, "New check: %s %s %s\n", Getattr(node, "name"), nodeType(node), Getattr(node, "kind"));
+ }
+ }
+*/
+ if (pname && node && Getattr(node, "sym:symtab")) {
+ /*
if (pname && node && checkAttribute(node, "kind", "function")) {
+ */
/*
For functions, add on a qualified name search, for example
struct Foo {