]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Drop warnings about unused internal symbols when using fast vapi files
authorJürg Billeter <j@bitron.ch>
Mon, 6 Aug 2012 12:00:40 +0000 (14:00 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 6 Aug 2012 12:00:40 +0000 (14:00 +0200)
It is impossible to determine whether internal symbols are used when
using fast vapi files.

Fixes bug 680218.

compiler/valacompiler.vala
vala/valacodecontext.vala
vala/valaflowanalyzer.vala

index c30614f0850fbfa480eeb3132507fee02007c1cd..c1c9f6f1804c675484415e9c36826cb39233166d 100644 (file)
@@ -1,6 +1,6 @@
 /* valacompiler.vala
  *
- * Copyright (C) 2006-2010  Jürg Billeter
+ * Copyright (C) 2006-2012  Jürg Billeter
  * Copyright (C) 1996-2002, 2004, 2005, 2006 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -266,6 +266,7 @@ class Vala.Compiler {
                                var source_file = new SourceFile (context, SourceFileType.FAST, rpath);
                                context.add_source_file (source_file);
                        }
+                       context.use_fast_vapi = true;
                }
                
                if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
index e68cf416c565fb52405ebb7cf4918b08927ce2d9..e716b3300ed4ed7f1927f5bc23cc97e5b5a4e068 100644 (file)
@@ -1,6 +1,6 @@
 /* valacodecontext.vala
  *
- * Copyright (C) 2006-2009  Jürg Billeter
+ * Copyright (C) 2006-2012  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -166,6 +166,8 @@ public class Vala.CodeContext {
 
        public bool nostdpkg { get; set; }
 
+       public bool use_fast_vapi { get; set; }
+
        /**
         * Returns true if the target version of glib is greater than or 
         * equal to the specified version.
index b059bbd64b0ac03b12edfa3b1e6d5d8ffedf7d94..45283377d36cdbfc371ede69c3aa9b6fb96fd050 100644 (file)
@@ -140,7 +140,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
 
        public override void visit_field (Field f) {
                if (f.is_internal_symbol () && !f.used) {
-                       if (!f.is_private_symbol () && context.internal_header_filename != null) {
+                       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 {
                                Report.warning (f.source_reference, "field `%s' never used".printf (f.get_full_name ()));
@@ -166,7 +166,7 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                if (m.is_internal_symbol () && !m.used && !m.entry_point
                    && !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) {
+                       if (!m.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 {
                                Report.warning (m.source_reference, "method `%s' never used".printf (m.get_full_name ()));