Commit Graph

3286 Commits

Author SHA1 Message Date
chriseth
0b9c842656 Fix abstract without contract. 2020-02-05 12:14:14 +01:00
chriseth
7cca036f4c
Merge pull request #8224 from a3d4/refactor-sourcelocation
Replaced SourceLocation::isEmpty() with isValid() and hasText().
2020-02-04 22:23:51 +01:00
alex
3416c029cf Relaxed assert in AsmJsonImporter::createAsmNode. 2020-02-04 20:37:51 +01:00
Daniel Kirchner
af9fc8b634 Mapping getters for Yul IR. 2020-02-04 17:22:03 +01:00
Daniel Kirchner
d3cbfb0c5c Allow user-defined types as mapping keys in parser and restrict to contracts during type checking. 2020-02-04 17:22:03 +01:00
alex
211227f50b Modified SourceLocation::hasText() to allow empty source. 2020-02-04 04:19:28 +01:00
alex
e4b18e85e6 Replaced SourceLocation::isEmpty() with isValid() and hasText().
The function SourceLocation::isEmpty() had somewhat dual role.
Sometimes it indicates that the SourceLocation is invalid.
Sometimes it means that there is no corresponding source text.

Hence the proposal is to replace it with two functions, isValid() and hasText().

I also removed Scanner::sourceAt(). (Do we have a rule of thumb to remove unused code?)

Since hasText() checks that start and end are valid indices for source, I adjusted a couple of tests to avoid empty source strings.
2020-02-03 08:04:21 +01:00
chriseth
2098dbade9
Merge pull request #7834 from ethereum/docstring-ast-node
[natspec] Introduce AST node for structured documentation
2020-01-30 19:04:52 +01:00
Erik Kundt
4a179056ed Adds JSON import / export for structured documentation. 2020-01-30 18:26:01 +01:00
Erik Kundt
ec27c2e507 Introduce AST node for structured documentation. 2020-01-30 18:25:56 +01:00
chriseth
ada0cef150
Merge pull request #8068 from ethereum/evmTypedDialect
[Yul] EVM typed dialect
2020-01-30 14:53:25 +01:00
cameel
642653ea04 Make yul::Parser::parse() return unique_ptr rather than shared_ptr
- unique_ptr is more flexible and generally recommended for factory methods. It gets automatically converted to shared_ptr if necessary. Returning shared_ptr, on the other hand, forces the caller to use shared_ptr because a conversion to unique_ptr is not possible.
2020-01-29 20:07:08 +01:00
chriseth
fbe5bb0cce Parse default dialect and omit when printing. 2020-01-29 17:25:25 +01:00
Mathias L. Baumann
5130a2b0ae
Merge pull request #8063 from ethereum/yulvisit-7656
Use yul::AstWalker for assembly reference resolving
2020-01-29 14:56:19 +01:00
chriseth
35820398c2
Merge pull request #8179 from pinkiebell/codegen
libsolidity/codegen: Use calldatacopy to cheaply zero memory..
2020-01-28 18:07:30 +01:00
Mathias Baumann
b8e2baf5f4 Use yul::AstWalker to resolve assembly symbols 2020-01-28 17:57:48 +01:00
chriseth
6ded158739 Change expression parts to use strings instead of numbers. 2020-01-27 08:55:11 +01:00
Erik Kundt
893fb4d05b Implements AST JSON import for function call options. 2020-01-23 21:20:01 +01:00
Mathias Baumann
a3f23d3158 Implement new with CREATE2 and function call options. 2020-01-23 21:20:01 +01:00
pinkiebell
bb6fb675e0 libsolidity/codegen: Use calldatacopy to cheaply zero memory instead of
codecopy.

Motiviation:
  Zero'ing memory is commonplace in contracts, but with the upcoming
  Layer-2 EVM translation layers and other on-chain verification
  mechanisms, using `codecopy` becomes a `costly` operation in those
  sandboxes. Using `calldatacopy` achieves the same thing, gas costs
  are also the same as codecopy, and is significantly cheaper in the `sandbox` situation.
2020-01-22 17:56:56 +01:00
Jason Cobb
573a054d5d
Prohibit interfaces inheriting from non-interfaces 2020-01-22 09:40:40 -05:00
Jason Cobb
1cc8ce1656
Don't prohibit interface inheritance 2020-01-22 09:40:40 -05:00
Daniel Kirchner
ee5ff4df4e Clean up visibility via contract name and fix ICE on calling unimplemented base function. 2020-01-16 19:13:04 +01:00
chriseth
185a736e13
Merge pull request #7918 from ethereum/compilerstack-fqdn
Add assertion for contract name clash in the resolver in CompilerStack
2020-01-15 18:00:58 +01:00
chriseth
c017072bac
Merge pull request #8013 from ethereum/warnings
Enable more warnings in the build system
2020-01-15 18:00:14 +01:00
Daniel Kirchner
c450b18673 Remove remaining instances of new. 2020-01-15 17:25:08 +01:00
Alex Beregszaszi
1d7f25e809 Remove unnecessary statement 2020-01-15 14:33:27 +00:00
Alex Beregszaszi
eafcb42be7 Enable more compiler warnings in the build system
"-pedantic -Wno-unknown-pragmas -Wimplicit-fallthrough"
2020-01-15 14:33:27 +00:00
chriseth
ed87b08911
Merge pull request #8066 from ethereum/removeAsmFlavour
Remove asm flavour
2020-01-15 14:21:54 +01:00
Nicolás Venturo
9649c92e12 Fix error message suggestion for receive 2020-01-14 23:24:27 +01:00
chriseth
b3fe84a6ea
Merge pull request #7153 from djudjuu/newImportAST
import ast from JSON
2020-01-14 17:56:53 +01:00
chriseth
123ea0a250 Remove asm flavour. 2020-01-14 17:16:09 +01:00
djudjuu
e8556fa1b2 Ast-Import from standard-json 2020-01-14 17:15:53 +01:00
Mathias Baumann
adc4774d4a ASTJSON: Export evm version 2020-01-14 12:51:21 +01:00
Christian Parpart
abb9f1eed7 CMake: Renaming devcore static library to solutil (to match source code paths) 2020-01-13 15:52:46 +01:00
Alex Beregszaszi
b85d478931 Add assertion for contract name clash in the resolver in CompilerStack 2020-01-10 11:49:44 +01:00
chriseth
a4e34b378a
Merge pull request #8105 from ethereum/functionTypeRefactor
Add a new Function Type referring to FunctionDefinition's without calling context and use it to allow selector lookup.
2020-01-09 17:15:46 +01:00
Daniel Kirchner
9535c0f520 Introduce FunctionKind::Declaration and allow accessing function signatures via contract name. 2020-01-09 15:40:41 +01:00
Jason Cobb
3726f7448e
Remove now-unused abstractAnnotation helper 2020-01-09 08:44:24 -05:00
Jason Cobb
dc380f017f
Make CallableDeclaration::annotation pure virtual 2020-01-09 08:37:32 -05:00
Jason Cobb
dc6c19cafa
Add methods for AST annotation implementation 2020-01-09 08:37:32 -05:00
Leonardo Alt
a02308cfa5 Replace void cast by maybe_unused 2020-01-09 13:41:30 +01:00
Mathias Baumann
2179562785 Move variables-in-interfaces checker to PostTypeChecker
refs #7566
2020-01-08 14:05:08 +01:00
Mathias Baumann
21844aa545 Move event-outside-emit check to PostTypeChecker
refs #7566
2020-01-08 14:05:08 +01:00
Mathias Baumann
9f8d49e358 Move modifier context check to PostTypeChecker
refs #7566
2020-01-08 14:05:08 +01:00
chriseth
5ca3abd7cb
Merge pull request #8106 from random-internet-cat/move-contract-kind
Move ContractKind from ContractDefinition to file-scope
2020-01-08 13:06:26 +01:00
chriseth
d1a7ff0fbc
Merge pull request #8008 from ethereum/large-code
Issue warning if codesize exceeds EIP-170 limits
2020-01-08 09:48:59 +01: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
Jason Cobb
529405deb6
Move ContractKind from ContractDefinition to file-scope 2020-01-07 09:11:29 -05:00