Commit Graph

6211 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
3236c2c573 C API: never return text structures by value
TN: S827-015
2019-08-29 17:15:22 +02:00
Pierre-Marie de Rodat
386a5b6cbc Python API: remove unused _kind_name binding
The Python bindings do not use this C API function as we generate the
kind name as node subclass attributes, so get rid of it.

TN: S827-015
2019-08-29 17:15:22 +02:00
Pierre-Marie de Rodat
8363f847c0 Generate language-specific file name for the GDB hook C source
This will avoid potential confusion in debuggers.

TN: R411-040
2019-08-28 15:57:29 +02:00
Pierre-Marie de Rodat
b162855f74 project_file.mako: no "C" units with --no-gdb-hooks
In the generated project file, declare that Ada is the only language
used in the project when --no-gdb-hooks is passed (GDB hooks are the
only reason we have a C unit).

TN: R411-040
2019-08-28 15:57:29 +02:00
Pierre-Marie de Rodat
f540b63a73 project_file.mako: fix handling of --no-gdb-hook
Until this commit, using this option would make the project_file.mako
template generate invalid GPR syntax: a trailing comma in the aggregate
for the Interfaces project attribute.

In order to fix this, we now compute the list of interfaces in
emitter.py, and just do formatting in the template.

TN: R411-040
2019-08-28 15:57:29 +02:00
Pierre-Marie de Rodat
f15f253543 Restore the generation of $.C units
The previous commit that removed it was done too quickly: projects
such as GPS need to convert public API values such as analysis contexts
and analysis units to the corresponding C values for its own Python
binding.
2019-08-20 14:34:45 +02:00
Pierre-Marie de Rodat
a5bf08a3a7 stylechecks: enforce two empty lines after imports
TN: S819-013
2019-08-20 14:34:45 +02:00
Pierre-Marie de Rodat
490ffaea62 Consistently use "cls" instead of "klass" to refer to classes 2019-08-20 14:34:45 +02:00
Pierre-Marie de Rodat
3bed682c36 Python API: add missing comments
TN: S806-012
2019-08-20 14:34:45 +02:00
Pierre-Marie de Rodat
42d3b79357 Add renamings to the mostly used Langkit_Support units and use them
TN: S607-029
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
8e620e0ade Remove unused Ada units and template files 2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
1778160603 pkg_analysis_spec_ada.mako: remove unused WITH
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
97b9db5d64 Remove internal notices, redundant with "private" packages
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
28e20951e5 Remove all conversions for bare nodes
Now that we use the same access type for all bare nodes, explicit
conversions are no longer necessary. This commit removes all such
conversions in templates and the facilities to create them in Langkit.

TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
ec9caf3e81 Use a single discriminated record type for all bare nodes
This commit changes the representation of bare nodes in the generated
code ($.Implementation). From distinct record types (one per node type),
we switch to a single discriminated record (discriminant is the kind).

In order to preserve separate type names for each node (including
abstract ones), this replaces the previous incompatible access types
with a single access type and one subtype for each node. A dynamic
predicates on all these subtypes allow us to rely on Ada semantics to
check at runtime (iff assertions are enabled) that expected node type
are used (for instance as actuals in function calls).

TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
15daef0665 ASTNodeType: turn value_type_name into a property
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
45ea029456 $.Implementation: add a Kind accessor function
This function will allow us to compute the kind of a node from a dynamic
predicate on bare node access types (i.e. before the Kind field is
available).

TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
c28f3958eb parsers/transform_code_ada.mako: minor reformatting
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
348c822d73 $.Common: generate kind subtype for abstract nodes with no derivation
This makes the generated Ada API more consistent (now *all* nodes have
such a subtype) and will make it easier to write predicates that involve
such nodes.

TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
3396f9b46f Simplify the name of predicate closures
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
5c4b6ea917 Add "pragma Unreferenced" when needed for various subp. formals
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
40f7694b34 Keep the Is_Env_Populated name constant in a single place
... and use the corresponding field's ".name" property in templates.
Upcoming changes will require this, as the name will no longer be a
constant.

TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
24632e45ba Move the "root_node_kind_name" template arg to a TypeRepo property
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
fd7358466b Use the same naming scheme for Short_Image overrides as for properties
TN: S311-015
2019-08-19 10:25:39 +02:00
Pierre-Marie de Rodat
f62fa57067 Rework the naming scheme for internal field accessors
The upcoming unification of types for bare nodes requires to have
distinct names for internal property overloads and field accessors. This
renaming decorates names to removes duplicates.

TN: S311-015
2019-08-19 10:25:39 +02:00