New eclcc option to surface ECL intermediate representation (IR)

Description

Request is to allow eclcc to easily emit the intermediate representation given ECL. From an offline email conversation:

FYI

Conclusion

None

Activity

Show:

Gavin Halliday February 4, 2022 at 3:44 PM

Yes the location annotations tie the expressions back to the original source - see the examples below.  Note there are also symbol annotations.

I have implemented the following:
-fgenerateIR - output the IR of the graph to stdout after the graph has been normalized (i.e. ready for processing)
-fgenerateIRAfterTransform - output the IR after various transforms have been applied
-firoptions=<n> - override a few details of the IR output. Values are ored together. 1 means inline simpletypes. 2 means inline atributes.

Here is a sample temp.ecl:

This is the output of before transform:

Here is a version after transformations, but keeping simple types inline (options default to 1):

There are various other places the IR could be generated, and It might be possible to generalise the code to configure that if it proved useful in the future. This should be enough to be getting on with though!

Dan Camper February 4, 2022 at 1:07 PM
Edited

If the emitted IR could include pointers back to source code (attribute file/line/pos) that would be extremely helpful as well.

EDIT: Is that the "{location '',1,1}" (as an example) information in the existing IR? If so, great!

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Components

Assignee

Reporter

Priority

Fix versions

Pull Request URL

Created February 4, 2022 at 12:44 PM
Updated February 8, 2022 at 3:38 PM
Resolved February 8, 2022 at 3:38 PM