]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
SourceFile: change the definition of 'used' 0.10-parallel
authorRyan Lortie <desrt@desrt.ca>
Mon, 20 Sep 2010 10:56:32 +0000 (06:56 -0400)
committerJürg Billeter <j@bitron.ch>
Wed, 6 Oct 2010 20:44:14 +0000 (22:44 +0200)
Consider a source file as used only if actual C code (or declarations)
have been generated from something in that source file.

This greatly reduces the number of dependencies listed for compilations
that touch a large number of symbols in trivial ways without really
making use of them (for example, when listing a very large number of
unused fast-vapi files, as parvala does).

codegen/valaccodedeclarationspace.vala
vala/valasourcefile.vala
vala/valasymbol.vala

index 4ff76409644ba5aa28983dde68df7fe0f8e48011..7c13be7899667ce65478fe56ac5c761be2166c44 100644 (file)
@@ -44,6 +44,7 @@ public class Vala.CCodeDeclarationSpace {
                if (add_declaration (name)) {
                        return true;
                }
+               sym.source_reference.file.used = true;
                if (sym.external_package || (!is_header && CodeContext.get ().use_header && !sym.is_internal_symbol ())) {
                        // add appropriate include file
                        foreach (string header_filename in sym.get_cheader_filenames ()) {
index 28397cf4b8bee123c713b00503a79906167fcd2a..9bb225f40b93764f081ffa4a6c076d59189cb8b8 100644 (file)
@@ -69,7 +69,7 @@ public class Vala.SourceFile {
 
        /**
         * If the file has been used (ie: if anything in the file has
-        * been found by symbol resolution).
+        * been emitted into C code as a definition or declaration).
         */
        public bool used { get; set; }
 
index 9caaa2789257e721687e4d8331b75045d1f22b1a..b63662456fb3f368aa9408d6375153cec2698ee0 100644 (file)
@@ -97,16 +97,7 @@ public abstract class Vala.Symbol : CodeNode {
        /**
         * Specifies whether this symbol has been accessed.
         */
-       public bool used {
-               get { return _used; }
-               set {
-                       _used = value;
-                       if (_used && source_reference != null) {
-                               source_reference.file.used = true;
-                        }
-               }
-       }
-       bool _used;
+       public bool used { get; set; }
 
        /**
         * Specifies the accessibility of this symbol. Public accessibility