Commit Graph

225 Commits

Author SHA1 Message Date
Alex Beregszaszi
9aafa32825 Disallow empty import statements 2019-01-28 13:52:15 +00:00
chriseth
a9fa2658d8 Add helper to show if contract can be deployed. 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
chriseth
4e89945d82 Some more compiler state tests. 2018-12-19 12:58:17 +01:00
chriseth
bd52beedff Cache hash computations. 2018-12-18 16:38:25 +01:00
Leonardo Alt
340ee4156d Sort includes in libsolidity/interface 2018-12-17 19:24:42 +01:00
chriseth
3a378eae1a Restrict toHex to bytes. 2018-12-05 22:37:05 +01:00
chriseth
aaeb74f592
Merge pull request #5537 from ethereum/cp-SourceLocation-related-refactoring
[1/3] SourceLocation related refactoring.
2018-11-30 23:45:31 +01:00
Christian Parpart
435f7b3b72 liblangutil: Scanner: remove superfluous sourceName field (it's in CharStream already)
Also, ParserBase::sourceName() was dead code. Eliminating it should
increase test coverage (how sneaky) :-)
2018-11-30 17:07:17 +01:00
Christian Parpart
c48a5264be
liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName
Also, adapted affecting code to those changes.
2018-11-30 17:07:12 +01:00
chriseth
0bd9db480f Add skeleton for contract level checker. 2018-11-30 16:30:19 +01:00
Christian Parpart
22eff22492 liblangutil: extends CharStream to know about the respective (file-)name (and adapt codebase to it) 2018-11-29 12:45:27 +01:00
chriseth
9a94e503da
Merge pull request #5491 from ethereum/libyul-as-library
Libyul as static library (version 3 ;( )
2018-11-23 17:01:18 +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
chriseth
bb10be789c Inject SMTLIB2 queries and responses via standard-json-io. 2018-11-23 09:43:49 +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
Alex Beregszaszi
d60cab1983 Add CompilerStack state assertions in internal methods 2018-11-14 10:47:26 +00:00
Alex Beregszaszi
be70703f82 Move lastContractName closer to contractNames 2018-11-14 10:29:16 +00:00
Alex Beregszaszi
5778af07a3 Do not crash on filesystemFriendlyName if no contracts were compiled 2018-11-14 10:29:16 +00:00
Leonardo Alt
9a4fd946c3 Add Scanner function that prints source based on SourceLocation 2018-11-13 13:49:29 +01:00
Daniel Kirchner
74557ceb0e Deterministic YulStringRepository using string hashes. 2018-11-12 23:43:16 +01:00
chriseth
0f2ba3522f Reset yul string repository. 2018-11-09 15:40:36 +01:00
Alex Beregszaszi
e732c49c2f Change find to use a single character 2018-10-09 18:06:25 +01:00
Alex Beregszaszi
d71cc66dde Use GasEstimator::dataGas in CompilerStack 2018-09-28 00:03:35 +01:00
liangdzou
808c3f3df5 fix some format typos 2018-09-17 22:13:21 +08:00
Daniel Kirchner
954d7433bd Disallow remappings with empty prefix. 2018-08-10 19:26:48 +02: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
901550e473
Merge pull request #4692 from ethereum/devcore-path
Move absolutePath/sanitizePath helpers from CompilerStack to libdevcore
2018-08-07 16:15:49 +02:00
chriseth
71e26f6adb Remove clone feature. 2018-08-07 11:10:50 +01:00
Alex Beregszaszi
3de0b8b7f0 Move absolutePath/sanitizePath helpers from CompilerStack to libdevcore 2018-08-06 12:54:22 +01:00
Alex Beregszaszi
f74cff622d Properly explain all the analsys steps in CompilerStack 2018-07-31 00:39:18 +01:00
Alex Beregszaszi
3fc7da11db Pull out createCBORMetadata helper 2018-06-25 22:17:33 +02:00
Alex Beregszaszi
a392e0f046 Properly catch optimizer/assembly exception in CompilerStack 2018-06-20 23:19:06 +02:00
Alex Beregszaszi
0a632011be CompilerStack absolutePath/sanitizePath can be made static 2018-06-20 17:04:22 +02:00
Alex Beregszaszi
dcee8e11ad Reorder some of the flow in CompilerStack::compileContract for readability 2018-06-20 17:01:17 +02:00
Daniel Kirchner
16e966dea0 Add control flow analyzer and test for uninitialized storage returns. 2018-05-14 20:23:40 +02:00
Daniel Kirchner
995623f0fa Add control flow graph. 2018-05-14 20:23:40 +02:00
Alex Beregszaszi
3730f68d4b reindent 2018-04-06 13:52:19 +02:00
Alex Beregszaszi
e8be0e61b3 Catch FatalError in CompilerStack::analysis to cover all the analysis tests 2018-04-06 13:52:19 +02:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
chriseth
a53d6b499d Use EVM version in type checker. 2018-03-01 17:19:35 +01:00
chriseth
f75a411325 Provide target EVM version in CompilerContext. 2018-03-01 17:19:35 +01:00
chriseth
85785710e6 Store EVM version in settings. 2018-03-01 17:19:34 +01:00
chriseth
5ab4a1ae78 Add ability to set the target EVM version. 2018-03-01 17:19:34 +01:00
chriseth
6807010dc7 Prevent libraries from being called. 2018-01-19 16:27:44 +01:00
Alex Beregszaszi
8d3cfa8cff Simplify contract lookup in CompileStack 2017-10-18 23:54:32 +01:00
Alex Beregszaszi
2ce35b77be Implement CompilerStack.lastContractName() 2017-10-18 23:54:32 +01:00
Alex Beregszaszi
f96e932243 Provide optional list of contract names to CompilerStack.compile 2017-10-04 20:30:14 +01:00
chriseth
3f3bcc4f8a Merge pull request #2848 from ethereum/checkViewPure
Enforce view and pure.
2017-09-13 18:29:13 +02:00
Alex Beregszaszi
bbfb16cf5c Introduce assemblyString 2017-09-11 15:53:20 +01:00
Alex Beregszaszi
50570c6c79 Do not return the stream in asssemblyStream 2017-09-11 15:48:58 +01:00
Alex Beregszaszi
a535a8b06e Split out the JSON functionality from assembly.stream() 2017-09-11 15:48:52 +01:00
chriseth
5470da4d9a View-pure checker. 2017-09-06 13:50:49 +02:00
Alex Beregszaszi
8e5f9c5981 Removed unused natspec members of ContractDefinition 2017-08-25 20:29:43 +01:00
Alex Beregszaszi
e6f55fb95e Do not create a new TypeChecker instance for every contract 2017-08-25 15:43:26 +01:00
Alex Beregszaszi
670df8e874 Attach natspec before type checking 2017-08-25 15:39:20 +01:00
Alex Beregszaszi
d60d4b3031 Remove duplicate work from CompilerStack.analyze() 2017-08-25 15:37:10 +01:00
chriseth
9ac2ac14c1 Rename read file callback. 2017-08-23 17:37:35 +02:00
chriseth
b3f8ed457a Cleanup. 2017-08-23 14:24:30 +02:00
chriseth
1ece7bf443 z3 conditions 2017-08-23 14:24:04 +02:00
Alex Beregszaszi
4219acaba9 Merge pull request #2771 from ethereum/unused-includes
Remove some unused includes
2017-08-21 16:26:44 +01:00
Alex Beregszaszi
b3986f1d07 Remove some unused includes 2017-08-21 14:08:58 +01:00
Alex Beregszaszi
7222fac456 Remove DocumentationType from natspec 2017-08-15 19:56:38 +01:00
Alex Beregszaszi
2d1bab0de8 Output experimental flag in metadata only for risky features 2017-08-11 16:38:43 +01:00
Alex Beregszaszi
4d82d4f57a Store experimental flag in metadata CBOR 2017-08-11 16:38:43 +01:00
Alex Beregszaszi
c835bcec62 Replace isFullyImplemented with unimplementedFunctions in ASTAnnotations 2017-08-04 14:03:37 +01:00
Alex Beregszaszi
9fc6eccc26 Add isFallback() helper 2017-07-27 21:52:57 +01:00
Alex Beregszaszi
89fadd6935 Merge pull request #2645 from ethereum/asserts
Use solAssert where possible
2017-07-27 11:12:30 +01:00
Yoichi Hirai
85b338a019 Merge pull request #2643 from ethereum/compilerstack
Reorder CompilerStack to be in logical order
2017-07-27 11:28:08 +02:00
chriseth
1298a8df14 Merge pull request #2566 from ethereum/metadata-only-relevant
Metadata: only include relevant files in the source list
2017-07-27 11:07:15 +02:00
Alex Beregszaszi
8098030986 Use solAssert instead of boost throw where possible 2017-07-26 22:23:21 +01:00
Alex Beregszaszi
9982e73dce Reorder CompilerStack to be in logical order 2017-07-26 22:16:02 +01:00
Alex Beregszaszi
30012db396 Add CompilerStack::setOptimiserSettings 2017-07-26 15:17:07 +01:00
Alex Beregszaszi
6848199b66 Add CompilerStack::setLibraries 2017-07-26 15:05:16 +01:00
Alex Beregszaszi
fa5a7efb45 Remove unused interfaces from CompilerStack 2017-07-26 15:05:16 +01:00
Alex Beregszaszi
c617336587 Only include files usde in metadata 2017-07-19 14:56:40 +01:00
Yoichi Hirai
2a46e1b0e2 Merge pull request #2589 from ethereum/rename-onchainmetadata
Rename onChainMetadata to metadata
2017-07-19 11:43:19 +02:00
Alex Beregszaszi
5bb4bfb08b Remove unneccesary interface from Natspec 2017-07-18 21:05:34 +01:00
Alex Beregszaszi
6d8929a71a Rename onChainMetadata to metadata 2017-07-18 20:54:28 +01:00
Alex Beregszaszi
555dc4f46f Remove Why3 generator 2017-06-25 12:26:16 +01:00
Alex Beregszaszi
b99e4bc68b Rework functionHashes into methodIdentifiers 2017-06-22 11:13:06 +01:00
Edward Ruchevits
5f7bca94e5 Reverted functionHashes output to use method signature as keys 2017-06-13 18:04:33 +01:00
Edward Ruchevits
2e816967d3 Allow including hashes of method signatures in --combined-json output 2017-06-13 17:03:17 +01:00
Alex Beregszaszi
998ca552b8 Fix state after CompilerStack.reset() 2017-06-01 13:44:08 +01:00
Alex Beregszaszi
c212d7c2e6 Remove unused functions from CompilerStack 2017-06-01 13:28:05 +01: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
40d5d5a956 Also change error message. 2017-05-26 11:13:32 +02:00
Alex Beregszaszi
8c3ec16132 Scanner requires only the SourcesSet state 2017-05-24 22:45:10 +01:00
Alex Beregszaszi
cd5d93da2a Rename CompilerStack.metadata to CompilerStack.natspec 2017-05-19 16:11:04 +01:00
Alex Beregszaszi
81877cc594 Rename InterfaceHandler to Natspec 2017-05-19 16:11:04 +01:00
Alex Beregszaszi
12328b7848 Split ABI out of InterfaceHandler 2017-05-19 16:11:03 +01:00
Alex Beregszaszi
4bf3cbb09a Use CompilerStack.contractABI directly 2017-05-19 15:57:36 +01:00
Alex Beregszaszi
8169e149c9 Rename CompilerStack.interface to CompilerStack.contractABI 2017-05-19 15:57:36 +01:00
Alex Beregszaszi
c0f31e4c1b Ensure proper checks are in CompilerStack 2017-05-11 08:02:03 +01:00
Alex Beregszaszi
5b4b620d8b Do not crash on AST if parsing failed 2017-05-11 08:02:03 +01:00
djuju
e9954eb325 conditional reset of compilerState-Enum 2017-04-28 18:46:27 +02:00
chriseth
f33614e1f7 Merge pull request #2171 from ethereum/splitParseAndAnalyze
refactoring parse() into two separate functions
2017-04-28 17:19:31 +02:00
djuju
a6306a1d44 error fixed 2017-04-28 16:20:32 +02:00