summaryrefslogtreecommitdiff
path: root/ccode
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-02-23 20:19:31 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-02-23 20:19:31 +0100
commitffc53c4a46455db8ce1bd8cdbb1a48a720c582e3 (patch)
tree686e19b79bc69c24e2fa631663ff619b751d083a /ccode
parent8b280ea51de9ed1bb0cbc8aeadfcf3bc604c356d (diff)
downloadvala-ffc53c4a46455db8ce1bd8cdbb1a48a720c582e3.tar.gz
codegen: Allow to associate CCodeFile to actual SourceFile
Diffstat (limited to 'ccode')
-rw-r--r--ccode/valaccodefile.vala6
1 files changed, 6 insertions, 0 deletions
diff --git a/ccode/valaccodefile.vala b/ccode/valaccodefile.vala
index e98d84bd0..6a8ae8ce3 100644
--- a/ccode/valaccodefile.vala
+++ b/ccode/valaccodefile.vala
@@ -24,6 +24,8 @@
public class Vala.CCodeFile {
public bool is_header { get; set; }
+ public weak SourceFile? file { get; private set; }
+
Set<string> features = new HashSet<string> (str_hash, str_equal);
Set<string> declarations = new HashSet<string> (str_hash, str_equal);
Set<string> includes = new HashSet<string> (str_hash, str_equal);
@@ -36,6 +38,10 @@ public class Vala.CCodeFile {
CCodeFragment constant_declaration = new CCodeFragment ();
CCodeFragment type_member_definition = new CCodeFragment ();
+ public CCodeFile (SourceFile? source_file = null) {
+ file = source_file;
+ }
+
public bool add_declaration (string name) {
if (name in declarations) {
return true;