mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add inlining for old optimizer.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
contract C {
|
||||
uint x;
|
||||
constructor() { x = a(); }
|
||||
function a() public pure returns (uint) { return f(); } // this should be inlined
|
||||
function f() internal pure returns (uint) { return 6; }
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
======= optimizer_inliner_call_from_constructor/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":60:263 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":89:115 constructor() { x = a(); } */
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":257:258 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":105:106 x */
|
||||
0x00
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":105:112 x = a() */
|
||||
sstore
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":60:263 contract C {... */
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":60:263 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x0dbe671f
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":120:175 function a() public pure returns (uint) { return f(); } */
|
||||
tag_3:
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":257:258 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":120:175 function a() public pure returns (uint) { return f(); } */
|
||||
mload(0x40)
|
||||
/* "#utility.yul":160:185 */
|
||||
swap1
|
||||
dup2
|
||||
mstore
|
||||
/* "#utility.yul":148:150 */
|
||||
0x20
|
||||
/* "#utility.yul":133:151 */
|
||||
add
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":120:175 function a() public pure returns (uint) { return f(); } */
|
||||
mload(0x40)
|
||||
dup1
|
||||
swap2
|
||||
sub
|
||||
swap1
|
||||
return
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
Reference in New Issue
Block a user