symtable: Override local status of imported symbols

When a symbol is imported as local, and subsequently directly imported using
another package with @export, the symbol needs to be overridden as
non-local.

* src/current/include/preproc/symtable.xsl
  (preproc:sym-discover): Deduplicate based on local status.
  (preproc:symtable-process-symbols): Retain non-local symbols when only
    local version of the symbol exists.
master
Mike Gerwitz 2017-12-19 16:48:44 -05:00
parent 60c01b22ba
commit c99e4d00f6
1 changed files with 14 additions and 0 deletions

View File

@ -274,6 +274,12 @@
or @name=$newresult/preproc:sym[ @type ]/@name
)
)
or (
@local = 'true'
and @name = following-sibling::preproc:sym[
not( @local = 'true' )
]/@name
)
)
]" />
@ -483,6 +489,14 @@
</xsl:copy>
</xsl:when>
<!-- if we have already imported the symbol as local, but this one
is non-local (exportable), then this one takes precedence -->
<xsl:when test="not( @local = 'true' )
and $dupall[ @local = 'true' ]
and not( $dupall[ not( @local = 'true' ) ] )">
<xsl:sequence select="." />
</xsl:when>
<xsl:when test="$dupall[ @type ]">
<!-- there is already a symbol of this name from the same package;
let's not add duplicates -->