From: Jürg Billeter Date: Mon, 6 Aug 2012 12:00:40 +0000 (+0200) Subject: Drop warnings about unused internal symbols when using fast vapi files X-Git-Tag: 0.17.4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d07f2e54b7be3ad54cd8be12f9e2d926c1263021;p=thirdparty%2Fvala.git Drop warnings about unused internal symbols when using fast vapi files It is impossible to determine whether internal symbols are used when using fast vapi files. Fixes bug 680218. --- diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index c30614f08..c1c9f6f18 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -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)) { diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index e68cf416c..e716b3300 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -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. diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala index b059bbd64..45283377d 100644 --- a/vala/valaflowanalyzer.vala +++ b/vala/valaflowanalyzer.vala @@ -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 ()));