[vala/0.44] vala: Run FlowAnalyzer on all given source-files



commit 0d92124bcbc79c1b71255790523b326b3e453322
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Sep 14 19:22:36 2019 +0200

    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

 vala/valaflowanalyzer.vala | 9 +++------
 1 file 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)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]