diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-09-14 19:22:36 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-09-14 19:27:24 +0200 |
commit | bbaae36410699887cf6b9cacee0181a78d0638f0 (patch) | |
tree | 0e006430c808c356bc2fdc481c552e2fbecc3e4b /vala/valaflowanalyzer.vala | |
parent | 2c46fb18e1c89e46105d05fef5eecfd14b872cfe (diff) | |
download | vala-bbaae36410699887cf6b9cacee0181a78d0638f0.tar.gz |
vala: Run FlowAnalyzer on all given source-files
This is a regression triggered by 8f3a0a0b64e0c7fbcc9231c3058247920dd6eeda
where we rely on information gathered by it and its changes to the AST.
Silence "never used" warnings for external-package symbols.
Fixes https://gitlab.gnome.org/GNOME/vala/issues/843
Diffstat (limited to 'vala/valaflowanalyzer.vala')
-rw-r--r-- | vala/valaflowanalyzer.vala | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala index dc7e471a3..29349e7a1 100644 --- a/vala/valaflowanalyzer.vala +++ b/vala/valaflowanalyzer.vala @@ -108,12 +108,9 @@ public class Vala.FlowAnalyzer : CodeVisitor { this.context = context; all_basic_blocks = new HashSet<BasicBlock> (); - /* we're only interested in non-pkg source files */ var source_files = context.get_source_files (); foreach (SourceFile file in source_files) { - if (file.file_type == SourceFileType.SOURCE) { - file.accept (this); - } + file.accept (this); } all_basic_blocks = null; @@ -145,7 +142,7 @@ public class Vala.FlowAnalyzer : CodeVisitor { } public override void visit_field (Field f) { - if (f.is_internal_symbol () && !f.used) { + if (f.is_internal_symbol () && !f.used && !f.external_package) { if (!f.is_private_symbol () && (context.internal_header_filename != null || context.use_fast_vapi)) { // do not warn if internal member may be used outside this compilation unit } else { @@ -169,7 +166,7 @@ public class Vala.FlowAnalyzer : CodeVisitor { } public override void visit_method (Method m) { - if (m.is_internal_symbol () && !m.used && !m.entry_point + if (m.is_internal_symbol () && !m.used && !m.entry_point && !m.external_package && !m.overrides && (m.base_interface_method == null || m.base_interface_method == m) && !(m is CreationMethod)) { if (!m.is_private_symbol () && (context.internal_header_filename != null || context.use_fast_vapi)) { |