Commit Graph

13 Commits

Author SHA1 Message Date
Kamil Śliwak
40dfac7683 [yul-phaser] Require specifying weights for Program::codeSize() 2020-05-20 16:47:23 +02:00
Kamil Śliwak
29186f9951 [yul-phaser] Program: Switch from using parseCode() to parseObject() 2020-03-23 16:31:19 +01:00
Kamil Śliwak
7107ef13a7 [yul-phaser] Program: Add parseObject() 2020-03-23 16:31:19 +01:00
Kamil Śliwak
8ca0d90aae [yul-phaser] Returning an ErrorList from Program::load() if program has errors and printing them in Phaser 2020-03-16 20:32:59 +01:00
Kamil Śliwak
9ef63a9789 [yul-phaser] Program: Output operator for ErrorList
- It does not seem universal enough to put it in liblangutil but in the scope of yul-phaser it's generic enough so I'm going to keep it together with Program.
2020-03-16 20:32:59 +01:00
cameel
57fb64d467 [yul-phaser] Make Program copyable by doing a deep copy of the AST in the copy constructor 2020-02-06 09:01:10 +01:00
cameel
a189c8b6e2 [yul-phaser] Pass unique_ptr rather than a mutable reference to Program::applyOptimisationSteps()
- Giving the function ownership of an object and then receiving back another object is better than letting it implicitly modify data passed in an argument.
2020-02-06 09:01:10 +01:00
cameel
785f65d0f5 [yul-phaser] Make Program and Population classes accept source code rather than file path
- I need some sample .yul files for testing but I see that existing tests generally have source code hard-coded in them rather than in standalone .yul files. There are lots of .yul files but they seem to be automatically processed by a special test case rather loaded ad-hoc by manually created tests.
- Program and Population required a file name until now. I'm making them accept loaded source code to be able to give them data hard-coded in a test.
2020-02-05 18:13:30 +01:00
cameel
21a2b69f74 [yul-phaser] Create OptimiserStepContext on demand instead of storing it in Program class
- This also lets us get rid of the static s_externallyUsedIdentifiers.
2020-02-05 18:13:30 +01:00
cameel
3baa191b94 [yul-phaser] Printing and JSON conversion for the Program class 2020-02-05 18:13:30 +01:00
cameel
2aa42b32e5 [yul-phaser] Make Program noncopyable
- Copying worked but resulted in OptimiserStepContext having a reference to NameDispenser instance of the other object.
2020-02-05 18:13:30 +01:00
cameel
14d726ff01 [yul-phaser] Program: Use unique_ptr rather than shared_ptr to hold a pointer to the AST root
- The class never shares the instance so unique_ptr makes more sense.
2020-02-05 18:13:30 +01:00
cameel
513d41c315 [yul-phaser] Add Program class 2020-02-05 18:13:30 +01:00