summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-09-20 06:56:32 -0400
committerJürg Billeter <j@bitron.ch>2010-10-06 22:44:14 +0200
commit2f3f9622f30facba85ca2396dc4f6c0ce0725687 (patch)
tree93730de9fa5e74ebb9250c3cda633ce45908b45e
parent976563bdc49133a793af6a3132e0a4aa7a85a7be (diff)
downloadvala-0.10-parallel.tar.gz
SourceFile: change the definition of 'used'0.10-parallel
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).
-rw-r--r--codegen/valaccodedeclarationspace.vala1
-rw-r--r--vala/valasourcefile.vala2
-rw-r--r--vala/valasymbol.vala11
3 files changed, 3 insertions, 11 deletions
diff --git a/codegen/valaccodedeclarationspace.vala b/codegen/valaccodedeclarationspace.vala
index 4ff764096..7c13be789 100644
--- a/codegen/valaccodedeclarationspace.vala
+++ b/codegen/valaccodedeclarationspace.vala
@@ -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 ()) {
diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala
index 28397cf4b..9bb225f40 100644
--- a/vala/valasourcefile.vala
+++ b/vala/valasourcefile.vala
@@ -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; }
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 9caaa2789..b63662456 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -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