Commit Graph

183 Commits

Author SHA1 Message Date
Daniel Kirchner
04d8ad2ae1 Legacy codegeneration for immutable state variables. 2020-03-24 16:45:25 +01:00
chriseth
fa148f2483 Parsing of immutable state variable. 2020-03-12 17:11:24 +01:00
a3d4
a86c511713 Replaced "assert" with "if" (incorrect contract code is not supposed to trigger asserts). 2020-03-12 14:03:27 +01:00
Daniel Kirchner
561e5d9b27 Rename variables and review suggestion. 2020-03-03 15:12:00 +01:00
Daniel Kirchner
90fa56c719 Allow use of yul util functions in legacy code generation. 2020-03-02 16:32:30 +01:00
chriseth
45041e5d3a Allow access to `_slot` for local storage pointer variables. 2020-02-25 14:28:04 +01:00
Mathias Baumann
80bd0f47cc Unify optimize yul code in CompilerContext/ContractCompiler 2020-02-11 13:55:47 +01:00
Mathias Baumann
1a3998648c Run yul optimizer on user code without refs 2020-02-11 13:55:47 +01:00
Leonardo Alt
36928c7a35 Add reason string for internal reverts 2020-02-10 11:57:20 -03:00
Christian Parpart
345f9928ab Library libdevcore renamed to libsolutil. 2020-01-07 15:51:50 +01:00
Christian Parpart
6b23412fae C++ namespace cleanup (except tests). 2020-01-07 15:51:50 +01:00
chriseth
e061f1e743 Merge remote-tracking branch 'origin/develop' into HEAD 2019-12-05 16:44:26 +01:00
Gaith Hallak
4d90180e24 Support referencing other constants in inline assembly 2019-12-05 13:27:17 +03:00
chriseth
138ee647f1 Provide different options for reason strings. 2019-11-07 14:13:53 +01:00
chriseth
cb2096c82a Add modifier depth to source mappings. 2019-11-05 16:50:38 +01:00
Daniel Kirchner
3321fc56ea Split fallback function and introduce "fallback()" and "receive()" syntax. 2019-11-04 17:17:58 +01:00
Christian Parpart
76c72ba89f Fixes signedness (causes compilation failure on MSVC). 2019-10-23 16:32:41 +02:00
chriseth
70b796bd1a Code generator for try/catch. 2019-09-23 17:22:56 +02:00
chriseth
cdd137e3d1 Support constant numbers in inline assembly. 2019-07-02 14:01:05 +02:00
mingchuan
492f945973
Coding style fix 2019-06-19 17:26:34 +08:00
chriseth
f2ae30f620 Fix handling of structs of dynamic size as constructor parameters. 2019-05-16 17:10:54 +02:00
Christian Parpart
721bf367a3
[libsolidity] TypeProvider: eliminate redundant "Type" suffix in provider function signatures. 2019-04-17 14:42:07 +02:00
Christian Parpart
bf43eebea9 libsolidity: Introducing TypeProvider API, for clear type system ownership. 2019-04-16 18:26:45 +02:00
chriseth
2308904f68 Remove "using namespace" from header and move Instruction to dev::eth. 2019-03-28 13:48:11 +01:00
chriseth
6d1ed93247 Use stack optimizations. 2019-03-14 15:34:23 +01:00
Alex Beregszaszi
bd51589f1a Use "if" instead of "switch" in codegen for the deployment time address of a library 2019-03-04 15:16:58 +01:00
chriseth
83d1382e78 Take yul optimizer setting into account. 2019-03-04 11:40:28 +01:00
chriseth
1ff562d28a Provide full optimiser settings to ContractCompiler. 2019-03-04 11:40:28 +01:00
Alex Beregszaszi
cf5c13f9c7 Introduce global optimiser settings. 2019-03-04 11:40:28 +01:00
chriseth
7f5b335b47 Make EVM version part of EVM dialect. 2019-02-21 21:59:46 +01:00
Daniel Kirchner
8ca6715e18 More style checks. 2019-02-14 11:41:20 +01:00
chriseth
02373c2225 Adjust uses of AsmCodeGen. 2019-02-13 11:35:49 +01:00
chriseth
29f6aa7d56 Do not create a copy of the assembly. 2019-01-17 20:36:48 +01:00
chriseth
e6fee257e6 Code generation for access to contract code. 2019-01-17 20:36:48 +01:00
Mathias Baumann
1b8570f829 Only generate sort/search code when interface functions exist 2018-12-17 21:24:37 +01:00
Leonardo Alt
ab76676271 Sort includes in libsolidity/codegen 2018-12-17 17:06:11 +01:00
Mathias Baumann
2f6dc2e773 Replace push_back with emplace_back where it makes sense 2018-12-10 19:02:39 +01:00
chriseth
7f39c3e522 Binary search for dispatch. 2018-12-06 13:07:14 +01:00
chriseth
7ee1ddc172 Switch namespaces. 2018-12-04 15:36:03 +01:00
chriseth
3ebb78a886 Adjust include paths. 2018-12-04 15:20:29 +01:00
chriseth
0e08fb7469 Use "in" tag for jumps from unpacker to function. 2018-11-26 11:02:58 +01:00
Christian Parpart
ec47c8946b
Isolating libyul library API into its own namespace yul. 2018-11-23 14:29:00 +01:00
Christian Parpart
713d94476e Reorder some include files and group <libyul/>'s together (as much as possible) 2018-11-23 12:37:19 +01:00
Christian Parpart
0f4ed52a71
Rewrite header paths to adapt to recent git mv of libsolidity/inlineasm to libyul 2018-11-23 11:18:57 +01:00
Christian Parpart
d67322a186 Introduce namespace langutil in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
Christian Parpart
87821c53c3 Isolating files shared between Yul- and Solidity language frontend. 2018-11-21 18:58:12 +00:00
chriseth
5e01d767d0 Prevent externally used functions from being removed. 2018-10-17 14:12:10 +02:00
Christian Parpart
1304361b9c
Renaming namespace dev::julia to dev::yul. 2018-10-15 11:58:51 +02:00
Alex Beregszaszi
fa0ce6a7e7 Use empty() instead of size() == 0 2018-10-09 04:29:37 +01:00
Alex Beregszaszi
a9819aa8bc Remove code generation for Throw statement
It is disallowed in the type system.
2018-08-08 17:02:25 +01:00
Alex Beregszaszi
9062704054
Merge pull request #4753 from mattaereal/boost-to-string-patch
Replace boost:lexical_cast<std::string> for std::to_string.
2018-08-08 16:07:25 +01:00
Matías Aereal Aeón
e902ce1aa0 Removing std:: from std::to_string and include for boost/lexical_cast 2018-08-08 11:26:30 -03:00
chriseth
71e26f6adb Remove clone feature. 2018-08-07 11:10:50 +01:00
Alex Beregszaszi
f74cff622d Properly explain all the analsys steps in CompilerStack 2018-07-31 00:39:18 +01:00
Daniel Kirchner
fc370591f0 Disallow multi variable declarations with mismatching number of values. 2018-07-12 20:33:51 +02:00
Leonardo Alt
0c5e0e0d59 Added assertion and tests suggestions 2018-07-10 18:39:38 +02:00
Leonardo Alt
b750ca9741 Add more tests and assertions 2018-07-10 18:39:38 +02:00
Leonardo Alt
9d895e002d Added tests and review suggestions 2018-07-10 18:39:38 +02:00
Leonardo Alt
1f77deada1 [050] Reserving and popping local vars in their scope 2018-07-10 18:39:38 +02:00
Alex Beregszaszi
1d57d74e82 Fail if break/continue statements are used outside for/while loops in ContractCompiler 2018-06-12 00:46:23 +01:00
Daniel Kirchner
f627dc77d0 Fix continue inside do-while. 2018-05-16 18:32:48 +02:00
chriseth
7a9ee69e98 Bubble up error messages. 2018-04-12 13:09:38 +02:00
Daniel Kirchner
3eedbc6a9c Error when using no parentheses in modifier-style constructor calls. 2018-04-10 12:09:34 +02:00
Daniel Kirchner
b918a105a4 Move constructor argument override check to TypeChecker and reuse annotations in ContractCompiler. 2018-04-09 15:26:08 +02:00
Daniel Kirchner
96eff0ff6a Error when using empty parenthesis for base class constructors that require arguments. 2018-04-05 11:52:22 +02:00
chriseth
a54fdc495f Fix: Treat empty base constructor argument list as not provided. 2018-04-03 14:53:48 +02:00
chriseth
32c94f5059 Simple size check for old ABI decoder. 2018-03-21 14:53:25 +00:00
chriseth
2cdf44f65c Move the old ABI decoder code. 2018-03-20 15:20:43 +00:00
chriseth
069b150e42 Bugfix in virtual lookup for modifiers in libraries. 2018-03-13 16:55:41 +01:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
chriseth
388718b59f Introduce emit statement. 2018-02-22 15:17:30 +01:00
chriseth
6807010dc7 Prevent libraries from being called. 2018-01-19 16:27:44 +01:00
chriseth
5a3dbb0269 Cleanup and overflow checks for data pointers. 2017-11-29 17:08:44 +01:00
chriseth
bdc1ff8ec7 ABI decoder. 2017-11-29 17:08:44 +01:00
chriseth
a3db1fc197 Do not accept truncated function selectors. 2017-10-17 23:17:36 +02:00
Alex Beregszaszi
204214f070 Split encodeToMemory to packedEncode and abiEncode 2017-09-27 11:32:19 +01:00
chriseth
22f85d5af3 Update tests and error messages. 2017-09-16 12:12:43 +01:00
chriseth
80ce3ca66f Move ABI encoder into its own function. 2017-09-15 20:46:32 +01:00
Alex Beregszaszi
7fb4a64136 Move all file specific globals to anonymous namespace 2017-08-29 11:09:18 +01:00
Alex Beregszaszi
2a5772cff7 Mark appropriate constructors explicit 2017-08-22 10:51:46 +01:00
chriseth
d1ad62fccc Experimental feature switch for ABI encoder. 2017-08-14 13:11:41 +01:00
Alex Beregszaszi
7d37eba4ba Remove the need of jumping out of the fallback 2017-07-27 21:52:58 +01:00
chriseth
d58e439094 Fix internal "variable already present" error. 2017-07-04 19:33:55 +02:00
chriseth
71d866cd7a Abort early if there is nothing to encode or decode. 2017-06-30 14:16:16 +02:00
Alex Beregszaszi
6a708b0cfe Document appendFunctionSelector 2017-06-28 18:00:40 +02:00
chriseth
ef9a7b2144 Stack adjustment and code generation for fallback function.
This assumes that the fallback function does not have return parameters.
2017-06-28 18:00:31 +02:00
chriseth
168f64f4cb Fix negative stack size checks. 2017-06-28 16:55:49 +01:00
Alex Beregszaszi
a0b0df2d98 Merge pull request #2460 from ethereum/disallowMultiModifier
Disallow invoking the same modifier multiple times.
2017-06-26 11:51:12 +01:00
chriseth
5a75581f66 Disallow invoking the same modifier multiple times. 2017-06-23 20:12:22 +02:00
chriseth
831ed08387 Change invalid opcode to revert for input validation. 2017-06-23 19:29:11 +02:00
chriseth
ef3d5874fe Remove error reporter from code generation phase. 2017-06-08 15:52:45 +02:00
chriseth
97cc968a13 Initial EVM1.5 assembly implementation. 2017-06-08 15:52:44 +02:00
Rhett Aultman
89b60ffbd4 Refactor error reporting
This commit introduces ErrorReporter, a utility class which consolidates
all of the error logging functionality into a common set of functions.
It also replaces all direct interactions with an ErrorList with calls to
an ErrorReporter.

This commit resolves issue #2209
2017-05-30 07:28:31 -07:00
chriseth
261731f7ee Adapt EVM codegen to new namespace. 2017-05-26 15:08:27 +02:00
chriseth
e2b21e1c96 Refactor to abstract assembly to JULIA. 2017-05-19 19:20:28 +02:00
chriseth
f3ec2ba39e Refactor to combined scope and stack height info. 2017-04-26 17:12:04 +02:00
chriseth
e841b23bfd Special case for storage types with offset zero. 2017-04-25 16:49:04 +02:00
chriseth
978884d9ca Build fix. 2017-04-25 16:49:04 +02:00
chriseth
478f2997ea Storage access from inline assembly. 2017-04-25 16:49:04 +02:00
chriseth
dfb7d5ebd9 Move analysis out of code generator. 2017-04-25 16:49:04 +02:00