mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
LLL: change (include) to use a callback
This commit is contained in:
+5
-4
@@ -28,13 +28,14 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
|
||||
bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _errors)
|
||||
|
||||
bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _errors, ReadCallback const& _readFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
CompilerState cs;
|
||||
cs.populateStandard();
|
||||
auto assembly = CodeFragment::compile(_src, cs).assembly(cs);
|
||||
auto assembly = CodeFragment::compile(_src, cs, _readFile).assembly(cs);
|
||||
if (_opt)
|
||||
assembly = assembly.optimise(true);
|
||||
bytes ret = assembly.assemble().bytecode;
|
||||
@@ -66,13 +67,13 @@ bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _error
|
||||
return bytes();
|
||||
}
|
||||
|
||||
std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::vector<std::string>* _errors)
|
||||
std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::vector<std::string>* _errors, ReadCallback const& _readFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
CompilerState cs;
|
||||
cs.populateStandard();
|
||||
auto assembly = CodeFragment::compile(_src, cs).assembly(cs);
|
||||
auto assembly = CodeFragment::compile(_src, cs, _readFile).assembly(cs);
|
||||
if (_opt)
|
||||
assembly = assembly.optimise(true);
|
||||
string ret = assembly.assemblyString();
|
||||
|
||||
Reference in New Issue
Block a user