After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 566863 - vala semantic analyser turns abstract syntax tree into abstract syntax DAG
vala semantic analyser turns abstract syntax tree into abstract syntax DAG
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other All
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-07 04:56 UTC by Allison Karlitskaya (desrt)
Modified: 2018-05-22 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Allison Karlitskaya (desrt) 2009-01-07 04:56:12 UTC
the semantic analyser contains code that turns the AST into a non-tree directed acyclic graph.

if you have a function defined:

  void func (bool arg = true);

and later:

  void func2 () {
    func ();
  }

then the semantic analyser turns that into:

  void func2 () {
    func (true);
  }

but it does so without copying the "true".  the "true" here is actually the "true" from the function declaration (including sharing its source_reference).

more to the point, if you set the ccodenode while visiting the first true, then when you arrive at the second true you will find that it has already been set.

this is pretty harmless, but it means the AST is not really a tree anymore.  it may also confuse code generators (because of the ccodenode thing).
Comment 1 Allison Karlitskaya (desrt) 2009-01-07 08:25:22 UTC
it also does it in the case that you have function bodies in the vapi, in which case it copies the entire function body.

both of these cases are being compiled multiple times under the current visitor setup.
Comment 2 Jürg Billeter 2009-01-07 12:21:37 UTC
In the first case we might want to clone the AST nodes.

Are you sure about the second case? I know that we visit the same AST nodes multiple times in the code generator in this case, but we never actually inline the bodies of the VAPI methods in the AST, if I remember correctly.
Comment 3 GNOME Infrastructure Team 2018-05-22 13:14:09 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/20.