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).
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 ()) {
/**
* 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; }
/**
* 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