mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
IRGenerator: Enable code generation for libraries
This commit is contained in:
parent
56a85d6cb3
commit
64bce597a1
@ -75,15 +75,15 @@ pair<string, string> IRGenerator::run(ContractDefinition const& _contract)
|
|||||||
|
|
||||||
string IRGenerator::generate(ContractDefinition const& _contract)
|
string IRGenerator::generate(ContractDefinition const& _contract)
|
||||||
{
|
{
|
||||||
solUnimplementedAssert(!_contract.isLibrary(), "Libraries not yet implemented.");
|
|
||||||
|
|
||||||
Whiskers t(R"(
|
Whiskers t(R"(
|
||||||
object "<CreationObject>" {
|
object "<CreationObject>" {
|
||||||
code {
|
code {
|
||||||
<memoryInit>
|
<memoryInit>
|
||||||
<callValueCheck>
|
<callValueCheck>
|
||||||
|
<?notLibrary>
|
||||||
<?constructorHasParams> let <constructorParams> := <copyConstructorArguments>() </constructorHasParams>
|
<?constructorHasParams> let <constructorParams> := <copyConstructorArguments>() </constructorHasParams>
|
||||||
<implicitConstructor>(<constructorParams>)
|
<implicitConstructor>(<constructorParams>)
|
||||||
|
</notLibrary>
|
||||||
<deploy>
|
<deploy>
|
||||||
<functions>
|
<functions>
|
||||||
}
|
}
|
||||||
@ -101,6 +101,7 @@ string IRGenerator::generate(ContractDefinition const& _contract)
|
|||||||
|
|
||||||
t("CreationObject", creationObjectName(_contract));
|
t("CreationObject", creationObjectName(_contract));
|
||||||
t("memoryInit", memoryInit());
|
t("memoryInit", memoryInit());
|
||||||
|
t("notLibrary", !_contract.isLibrary());
|
||||||
|
|
||||||
FunctionDefinition const* constructor = _contract.constructor();
|
FunctionDefinition const* constructor = _contract.constructor();
|
||||||
t("callValueCheck", !constructor || !constructor->isPayable() ? callValueCheck() : "");
|
t("callValueCheck", !constructor || !constructor->isPayable() ? callValueCheck() : "");
|
||||||
|
Loading…
Reference in New Issue
Block a user