Merge branch 'master' into doxygen

Merge 3.0.12 release changes from master.
This commit is contained in:
Vadim Zeitlin 2017-02-01 02:21:35 +01:00
commit 294ab27b90
254 changed files with 4158 additions and 2457 deletions

View file

@ -799,6 +799,8 @@ static int need_name_warning(Node *n) {
need = 0;
} else if (Getattr(n, "templatetype")) {
need = 0;
} else if (GetFlag(n, "parsing_template_declaration")) {
need = 0;
}
return need;
}

View file

@ -402,6 +402,7 @@ extern int ParmList_is_compactdefargs(ParmList *p);
extern void Swig_typemap_clear(const_String_or_char_ptr tmap_method, ParmList *pattern);
extern int Swig_typemap_apply(ParmList *srcpat, ParmList *destpat);
extern void Swig_typemap_clear_apply(ParmList *pattern);
extern void Swig_typemap_replace_embedded_typemap(String *s, Node *file_line_node);
extern void Swig_typemap_debug(void);
extern void Swig_typemap_search_debug_set(void);
extern void Swig_typemap_used_debug_set(void);

View file

@ -518,7 +518,6 @@ void Swig_symbol_inherit(Symtab *s) {
void Swig_symbol_cadd(const_String_or_char_ptr name, Node *n) {
Node *append = 0;
Node *cn;
/* There are a few options for weak symbols. A "weak" symbol
is any symbol that can be replaced by another symbol in the C symbol
@ -1907,19 +1906,37 @@ SwigType *Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
int len = Len(elements);
int i;
#ifdef SWIG_TEMPLATE_DEFTYPE_CACHE
static Hash *deftype_cache = 0;
String *scopetype = tscope ? NewStringf("%s::%s", Getattr(tscope, "name"), type)
static Hash *s_cache = 0;
Hash *scope_cache;
/* The lookup depends on the current scope and potential namespace qualification.
Looking up x in namespace y is not the same as looking up x::y in outer scope.
-> we use a 2-level hash: first scope and then symbol. */
String *scope_name = tscope
? Swig_symbol_qualifiedscopename(tscope)
: Swig_symbol_qualifiedscopename(current_symtab);
String *type_name = tscope
? NewStringf("%s::%s", Getattr(tscope, "name"), type)
: NewStringf("%s::%s", Swig_symbol_getscopename(), type);
if (!deftype_cache) {
deftype_cache = NewHash();
if (!scope_name) scope_name = NewString("::");
if (!s_cache) {
s_cache = NewHash();
}
if (scopetype) {
String *cres = Getattr(deftype_cache, scopetype);
scope_cache = Getattr(s_cache, scope_name);
if (scope_cache) {
String *cres = Getattr(scope_cache, type_name);
if (cres) {
Append(result, cres);
Delete(scopetype);
#ifdef SWIG_DEBUG
Printf(stderr, "cached deftype %s(%s) -> %s\n", type, scope_name, result);
#endif
Delete(type_name);
Delete(scope_name);
return result;
}
} else {
scope_cache = NewHash();
Setattr(s_cache, scope_name, scope_cache);
Delete(scope_name);
}
#endif
@ -2019,8 +2036,8 @@ SwigType *Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope) {
}
Delete(elements);
#ifdef SWIG_TEMPLATE_DEFTYPE_CACHE
Setattr(deftype_cache, scopetype, result);
Delete(scopetype);
Setattr(scope_cache, type_name, result);
Delete(type_name);
#endif
return result;

View file

@ -1876,6 +1876,21 @@ static List *split_embedded_typemap(String *s) {
return args;
}
/* -----------------------------------------------------------------------------
* Swig_typemap_replace_embedded_typemap()
*
* For special variable macro $typemap(...) expansion outside of typemaps.
* Only limited usage works as most typemap special variables ($1, $input etc)
* are not expanded correctly outside of typemaps.
* ----------------------------------------------------------------------------- */
void Swig_typemap_replace_embedded_typemap(String *s, Node *file_line_node) {
Setfile(s, Getfile(file_line_node));
Setline(s, Getline(file_line_node));
Replaceall(s, "$typemap", "$TYPEMAP");
replace_embedded_typemap(s, 0, 0, file_line_node);
}
/* -----------------------------------------------------------------------------
* replace_embedded_typemap()
*