[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.
This commit is contained in:
cameel
2020-02-05 18:13:30 +01:00
parent 7b7c88ae95
commit 785f65d0f5
5 changed files with 37 additions and 30 deletions
+1 -2
View File
@@ -65,7 +65,7 @@ public:
{}
Program operator=(Program&& program) = delete;
static Program load(std::string const& _sourcePath);
static Program load(langutil::CharStream& _sourceCode);
void optimise(std::vector<std::string> const& _optimisationSteps);
size_t codeSize() const { return computeCodeSize(*m_ast); }
@@ -84,7 +84,6 @@ private:
m_nameDispenser(_dialect, *m_ast, {})
{}
static langutil::CharStream loadSource(std::string const& _sourcePath);
static std::unique_ptr<yul::Block> parseSource(
yul::Dialect const& _dialect,
langutil::CharStream _source