Commit Graph

327 Commits

Author SHA1 Message Date
chriseth
0bd049c849 Adapet uses of AssemblyStack. 2019-02-13 12:23:07 +01:00
Bhargava Shastry
7751fa740f Ensure we fail gracefully when user tries to optimize Yul code 2019-02-12 11:21:02 +01:00
Christian Parpart
cebeb4076c Fixes compilation on Windows where STDERR_FILENO seems not to be present. 2019-02-11 15:27:08 +01:00
Christian Parpart
3d4b0f45da liblangutil: refactors SourceReferenceFormatter error formatting for pretty and colored output.
* Refactors output format in a way it is (or should at least be) more readable.
  (NB.: As source of inspiration, I chose the rustc compiler output.)
* Adds color support to the stream output.
* Also improves multiline source formatting
  (i.e. truncating too long lines, like done with single lines already)
* solc: adds flags --color (force terminal colors) and --no-color (disable autodetection)
* solc: adds --new-reporter to give output in *new* formatting (colored or not)
* Changelog adapted accordingly.
2019-02-07 12:55:14 +01:00
Alex Beregszaszi
8c97fb1688 Remove boost::filesystem::weakly_canonical workaround 2019-01-18 17:59:32 +00:00
Christian Parpart
62fe57479e
make use of C++ = default constructor declarations as well as more non-static member initialization syntax. 2018-12-19 11:26:42 +01:00
Christian Parpart
073b03d90c liblangutil: refactor SourceReferenceFormatter, splitting out retrieval and making use of new SourceLocation's CharStream knowledge 2018-12-06 14:01:01 +01:00
chriseth
6c44c5f0c9 Apply the optimize commandline parameter to assembly mode. 2018-11-30 23:39:05 +01:00
Erik Kundt
50351fb8e2 Fixes crash on empty runtime code. 2018-11-28 14:41:16 +01:00
Christian Parpart
aeb66905de
Moving SourceReferenceFormatter into langutil namespace. 2018-11-24 12:33:36 +01:00
liangdzou
87d1276dc8 Notify user on successful run without output. 2018-11-22 18:06:29 +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
0690aae09d Remove mostly unused writeFile implementation. 2018-10-18 12:50:06 +02:00
mestorlx
9f9d6fdcc4 fix issue##5007 2018-10-15 14:26:15 -03:00
chriseth
95d3e7feb3 More helpful error messages for linker. 2018-10-12 15:15:02 +02:00
chriseth
6daeb39ecc Use hash for library placeholders. 2018-10-12 15:15:01 +02:00
liangdzou
6f7ff2dcd4 fix format issue for source files 2018-09-20 17:41:59 +08:00
liangdzou
24e5dcc352 fix code format problems 2018-09-19 00:18:49 +08:00
Daniel Kirchner
954d7433bd Disallow remappings with empty prefix. 2018-08-10 19:26:48 +02:00
chriseth
8e93b729a4
Merge pull request #4703 from ethereum/solc-fix-double-quoting-path-names
solc: Fixes double-quoting path names on stderr.
2018-08-07 21:46:00 +02:00
Christian Parpart
39ffd7500e
solc: Fixes double-quoting path names on stderr and adds tests for it.
Before it was possible to get a failure message, such as:

    ""notfound.sol"" is not found

whereas it should be:

    "notfound.sol" is not found.
2018-08-07 14:55:22 +02:00
Alex Beregszaszi
21ceac090a
Merge pull request #4592 from asifmallik/fixBackslashBugFinal
Fix backslash bug
2018-08-07 12:47:37 +01:00
chriseth
71e26f6adb Remove clone feature. 2018-08-07 11:10:50 +01:00
Asif Mallik
fba7b7c204 Fix backslash bug 2018-08-06 18:17:56 +02:00
chriseth
236284a264
Merge pull request #4166 from alibabe/fix-3718-ret
Fix the Heisenbug
2018-07-16 13:38:42 +02:00
Cryptomental
140dbfdbd8 Code, Changelog, ReleaseChecklist: Fix typos.
Refs: #4442
2018-07-11 00:26:23 +02:00
Alex Beregszaszi
782bc41dbd Rename JULIA/IULIA to Yul in assembly interface 2018-06-14 09:31:28 +01:00
Alex Beregszaszi
ba2a7294d8 Renamed the --julia CLI option to --yul 2018-06-14 00:09:00 +01:00
Alex Beregszaszi
2625f282b9 Remove obsolete --formal option from CLI 2018-06-13 01:00:51 +01:00
alibabe
53eafff4bb Fixes #3718 by creating a local variable for the result of
`GasEstimator::breakToStatementLevel` and then assign it back to
gasCoast.
2018-05-29 04:58:03 +00:00
Leonardo Alt
db5ea8ec03 Read from stdin only if - is explicitly given 2018-05-07 09:32:46 +02:00
Jonny Burger
1367fedfd0 Improve documentation and CLI help for --run parameter 2018-05-02 17:10:30 +02:00
Alex Beregszaszi
7626c8ab72
Merge pull request #3855 from ldct/patch-3
mark --formal as deprecated in cli options
2018-04-11 20:57:01 +01:00
Li Xuanji
576964bd01 Mark --formal as deprecated in CLI options 2018-04-11 20:08:41 +01:00
Daniel Kirchner
c15cb6cc7a Prevent information about file existence outside the allowed paths to leak by mimicing boost::filesystem::weakly_canonical. 2018-04-11 18:52:22 +02:00
Sergiusz Bazanski
f39f36f2c7 Fix file missing error message on imports.
Trying to convert an import path into a Boost canonical path causes
boost to throw an exception if the given file does not exist. Thus,
instead of geting to the 'File not found' error, we instead got into the
cath-all handler for 'Unknown exception in read callback'.

This change rearranges the file checks to happen before we create a
canonical Boost path. It also drive-by removes the unnecessary 'else'
block, as the body of the if is a guard-like return block.
2018-04-06 11:03:52 +02:00
Anthony Broad-Crawford
8a18f22b87 Support for error on non-existant or irregular files with command line option to ignore 2018-03-28 10:25:43 +01:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
chriseth
4ce0e7775d Add constantinople. 2018-03-01 17:19:35 +01:00
chriseth
982476f99d Add TangerineWhistle. 2018-03-01 17:19:35 +01:00
chriseth
dc317a44e0 Provide EVM version to assembly analysis. 2018-03-01 17:19:35 +01:00
chriseth
5ab4a1ae78 Add ability to set the target EVM version. 2018-03-01 17:19:34 +01:00
Zhen Zhang
5fd9ea4b2a Stop allow_guessing for command line option parser 2018-02-28 09:31:24 +08:00
Federico Bond
d7532f7b9c Convert static SourceReferenceFormatter functions to member ones 2018-02-19 15:04:22 +01:00
Alex Beregszaszi
bc1fffb42f Support --strict-assembly in CLI 2018-01-06 03:28:12 +00:00
Alex Beregszaszi
1734d44561 Rename jsonCompiler to libsolc 2017-12-11 12:49:08 +00:00
Alex Beregszaszi
123d85a19e Request all outputs in JSONCompiler 2017-11-29 20:10:18 +00:00
chriseth
4e7d1440ab Merge pull request #3101 from ethereum/compilerstack-header
Remove the reliance on empty contract name equals "last contract" in CompilerStack
2017-10-19 13:43:17 +02:00
Alex Beregszaszi
2ce35b77be Implement CompilerStack.lastContractName() 2017-10-18 23:54:32 +01:00
Alex Beregszaszi
039cc25b1f Always require a contract/sourceName in CompilerStack 2017-10-18 23:32:33 +01:00
Alex Beregszaszi
6f2865228c Add readStandardInput helper 2017-10-18 12:56:11 +01:00
Alex Beregszaszi
7186e142b8 Rename contentsString to readFileAsString 2017-10-18 12:55:12 +01:00
Sergiusz Bazanski
a458100175 Do not use remove_trailing_separator from Boost 1.58 as 1.56 is required 2017-10-06 13:55:18 +01:00
Sergiusz Bazanski
71a819654e Allow trailing slash in solc -allow-paths. 2017-10-06 13:55:18 +01:00
Ali92hm
61dabb2f29 Added --pretty-json commandline option 2017-09-12 21:51:28 +01:00
Ali92hm
487ade1635 Enabling --combined-json to output to file 2017-09-12 21:50:22 +01:00
Ali92hm
1a9c503e93 Added createJson method to make writing json easier 2017-09-12 21:50:22 +01:00
Alex Beregszaszi
bd6510d99a Simplify assembly printing in CLI 2017-09-11 15:53:20 +01:00
Alex Beregszaszi
bbfb16cf5c Introduce assemblyString 2017-09-11 15:53:20 +01:00
Alex Beregszaszi
a535a8b06e Split out the JSON functionality from assembly.stream() 2017-09-11 15:48:52 +01:00
Alex Beregszaszi
c861817875 Add header for jsonCompiler 2017-08-29 13:43:55 +01:00
chriseth
9ac2ac14c1 Rename read file callback. 2017-08-23 17:37:35 +02:00
Alex Beregszaszi
3b07c4d38e Merge pull request #2757 from ethereum/cmake
Static linking
2017-08-23 12:36:24 +01:00
Paweł Bylica
4974ff3962
CMake: Add option to static link solc 2017-08-22 22:50:25 +02:00
chriseth
e3f90565d8 Avoid some Json copy operations. 2017-08-21 16:28:30 +01:00
Paweł Bylica
6f72025ee7
CMake: Simplify solc config 2017-08-18 13:32:36 +02:00
Alex Beregszaszi
7222fac456 Remove DocumentationType from natspec 2017-08-15 19:56:38 +01:00
Alex Beregszaszi
3e2f0b589d Remove some global symbols 2017-08-09 12:44:53 +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
6d8929a71a Rename onChainMetadata to metadata 2017-07-18 20:54:28 +01:00
Alex Beregszaszi
e9226225d7 Properly export the license() method in Emscripten 2017-07-18 15:31:49 +01:00
chriseth
c78a3a0b01 Add other licenses. 2017-07-01 22:59:08 +01:00
Alex Beregszaszi
c5947ae6e3 Remove Why3 error class 2017-06-30 22:30:43 +01:00
Alex Beregszaszi
555dc4f46f Remove Why3 generator 2017-06-25 12:26:16 +01:00
Alex Beregszaszi
ea6cf619fd Rewrite jsonCompiler using StandardCompiler 2017-06-22 13:01:46 +01:00
Alex Beregszaszi
ba7d698ee6 Make compiler.contractDefinition private 2017-06-22 11:13:06 +01:00
Alex Beregszaszi
b99e4bc68b Rework functionHashes into methodIdentifiers 2017-06-22 11:13:06 +01:00
chriseth
9084d48750 Merge pull request #2382 from ruchevits/combined-json-hashes
Allow including hashes of method signatures in --combined-json output
2017-06-15 10:10:18 +02:00
Alex Beregszaszi
412802a6c1 Include license text in emscripten output 2017-06-14 14:14:01 +01:00
chriseth
e232a105f0 Merge pull request #2327 from ethereum/assembler-object
Return assembler object in AssemblyStack
2017-06-14 14:28:06 +02:00
Edward Ruchevits
7c7df6f38b Removed duplicate code 2017-06-13 17:11:15 +01:00
Edward Ruchevits
2e816967d3 Allow including hashes of method signatures in --combined-json output 2017-06-13 17:03:17 +01:00
chriseth
f583008c73 Remove copyright notice. 2017-06-12 12:28:17 +02:00
Alex Beregszaszi
762bec9116 Nicer machine output in CLI 2017-06-09 16:40:14 +02:00
Alex Beregszaszi
ca92bda886 Supply text representation of assembly 2017-06-09 16:40:14 +02:00
Alex Beregszaszi
f0d213e6b5 Introduce MachineAssemblyObject 2017-06-09 16:40:14 +02:00
chriseth
9d0691b47a Include license and warranty statement with solc. 2017-06-09 13:11:15 +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
002df12d13 Merge pull request #2287 from ethereum/legacyAstCLI
add legacy/compact AST-format options to CLI
2017-05-29 14:24:55 +02:00
chriseth
261731f7ee Adapt EVM codegen to new namespace. 2017-05-26 15:08:27 +02:00
chriseth
eaa13d42a0 Support multiple assembly front and backends. 2017-05-26 15:03:29 +02:00
chriseth
f2804c49ed Handle assembly in one go to allow for different stacks. 2017-05-26 11:50:26 +02:00
chriseth
9a23603af2 Commandline options. 2017-05-26 11:50:26 +02:00
djudjuu
1131c5035f make src-indices equal (#2286) 2017-05-24 14:48:32 +02:00
djudjuu
0f7a9e8149 add legacy/compact AST-format options to CL 2017-05-24 14:48:32 +02:00
chriseth
8eead553af Merge pull request #1810 from ethereum/compactJson
Compact format for AST-Json.
2017-05-22 14:33:46 +02:00
Alex Beregszaszi
bbef2cd4a8 Rename handleMeta to handleNatspec 2017-05-19 16:11:04 +01:00
Alex Beregszaszi
cd5d93da2a Rename CompilerStack.metadata to CompilerStack.natspec 2017-05-19 16:11:04 +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
chriseth
dea7b864e6 Compact format for AST-Json with backwards compatibility 2017-05-17 11:14:33 +02:00
Alex Beregszaszi
a95c86e8e4 Catch errors gracefully in CLI assembler 2017-05-06 10:43:58 +01:00
Alex Beregszaszi
4eae971b31 Export compileStandard on emscripten 2017-04-24 16:36:37 +01:00
chriseth
017fedebfe Add missing space. 2017-04-24 14:22:39 +02:00
Alex Beregszaszi
b7951be44a Add exception guard to ReadFileCallback in CLI 2017-04-22 14:08:28 +01:00
Alex Beregszaszi
4566b4b336 Pass readFileCallback to StandardCompiler in CLI 2017-04-20 23:22:23 +01:00
Alex Beregszaszi
ed64c849f5 Merge pull request #2145 from ethereum/cli-readfile-permissions
Check for path permissions before opening file in the CLI file reader
2017-04-20 20:31:27 +01:00
Alex Beregszaszi
b30fad4a49 Check for path permissions before opening file in the CLI file reader 2017-04-20 20:01:17 +01:00
Alex Beregszaszi
4f3c76364c Export StandardCompiler as compileStandard in soljson 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
8c9e57fadf Add --standard-json to solc 2017-04-20 19:38:00 +01:00
Alex Beregszaszi
8bf842050e Support --allow-paths in the CLI 2017-04-20 15:39:30 +01:00
Alex Beregszaszi
54dcb0e11b Keep gas values as a string in CompilerStack::gasEstimate 2017-04-13 02:18:29 +01:00
Alex Beregszaszi
fe4fccaaf2 The gasEstimates objects must always be present in the jsonCompiler even if empty (backwards compat) 2017-04-13 02:17:40 +01:00
Alex Beregszaszi
328f2b0a8e Use new gasEstimate in CLI 2017-04-13 02:17:40 +01:00
Alex Beregszaszi
d90fd439e2 Use new gasEstimate in jsonCompiler 2017-04-13 02:17:40 +01:00
Alex Beregszaszi
bd48f181b5 Merge pull request #2098 from ethereum/sourceformatter
Introduce formatExceptionInformation
2017-04-10 14:46:59 +01:00
Alex Beregszaszi
a182dfe266 Remove empty wrapper formatError from jsonCompiler 2017-04-10 14:07:37 +01:00
Alex Beregszaszi
b1db6eac8b Introduce formatExceptionInformation 2017-04-10 14:07:36 +01:00
Alex Beregszaszi
623b8eb107 Pull out ReadFile from CompilerStack 2017-04-10 12:49:47 +01:00
Alex Beregszaszi
e0ff70778a Rename ErrorMesage to ErrorMessage 2017-03-16 23:59:36 +00:00
chriseth
14196f2621 Allow long library names. 2017-03-14 11:58:43 +01:00
chriseth
31a5e5bfef Do not overwrite files unless forced. 2017-03-10 19:23:43 +01:00
chriseth
7a24a5764e Add line info to serious exceptions. 2017-02-24 19:32:41 +01:00
Alex Beregszaszi
a5d0fd9c8a Do not create directories . and .. 2017-02-06 14:27:54 +00:00
Alex Beregszaszi
46412473b6 Always escape filenames in solc 2017-02-05 19:19:29 +00:00
VoR0220
b3f0d713a1
fix for linker wrt binaries generated with import statements
Signed-off-by: VoR0220 <rj@erisindustries.com>
2017-01-30 13:41:33 -06:00
Alex Beregszaszi
102fd7ee5d Merge pull request #1604 from ethereum/checksums
Warn about invalid checksums of addresses.
2017-01-26 14:42:34 +00:00
Alex Beregszaszi
024061b828 Merge pull request #1610 from ethereum/assemblyModeError
Proper error reporting for assembly mode.
2017-01-26 14:41:39 +00:00
Alex Beregszaszi
84bf547f21 Add option to solc to use literal sources in metadta 2017-01-26 13:24:59 +00:00
chriseth
8e29d636f7 Header cleanup. 2017-01-26 13:47:57 +01:00
chriseth
1b097fd3c7 Proper error reporting for assembly mode. 2017-01-26 13:45:23 +01:00
chriseth
3949624a61 Also check library addresses. 2017-01-24 23:37:48 +01:00
Rhett Aultman
610156fb92 Fix bad merge artifact(?)
Looks like merging up munged line 188 in CommandLineInterface.cpp,
so that a string literal was being used where a global variable should
be.
2017-01-16 12:32:58 -05:00
Rhett Aultman
0c98e4b2da Stylistic corrections 2017-01-16 12:32:57 -05:00
Rhett Aultman
071b936b37 Only avoid collision if it's the same file
@chriseth had suggested that it would be better if contracts were
referenced in a file:contract notation, and that we output .bin files
that prepend original path names if necessary to avoid a collision.

This commit is mostly a draft; it still needs to be run through the test
suite.
2017-01-16 12:32:57 -05:00
chriseth
c111d6e27e Merge pull request #1491 from ameten/refactoring
Just refactored some code
2016-12-12 21:43:04 +01:00
Federico Bond
dac95ce398 Remove unused variable inputFiles 2016-12-11 00:41:41 -03:00
Danil Nemirovsky
e5a992937c - alphabetically sorted string constants per name. 2016-12-08 21:33:09 +03:00
Danil Nemirovsky
f1cf9eb1ea - moved string constants into common place;
- replaced string literals with string constants.
2016-12-08 21:33:09 +03:00
Alex Beregszaszi
35325ee7c3 Update metadata documentation 2016-12-01 16:03:59 +01:00
chriseth
659b635b2d Make sure some keys are present. 2016-12-01 16:03:59 +01:00
chriseth
5789eaa78d Metadata stamp. 2016-12-01 16:03:59 +01:00
Federico Bond
29e304d3bc Fix typos (existant -> existent) 2016-12-01 01:29:30 -03:00
VoR0220
3f9f725737 Fix licensing headers
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
Alex Beregszaszi
81c50143f2 Move JSON helpers to libdevcore/json 2016-11-15 17:38:18 +00:00
Alex Beregszaszi
9719cf38e6 Move InterfaceHandler from string to JSON 2016-11-15 15:55:25 +00:00
Rhett Aultman
58e75c7a48 Unimplemented features moved to their own exception (#1361)
Unimplemented features moved to their own exception

InternalCompilerError is an exception that really should be reserved for
actual internal errors of the compiler.  Unimplemented features can now
use either solUnimplemented( ) or, if it should be conditional, then
solUnimplementedAssert( ).

* Revert some unimplemented exceptions, add handlers

The jsonCompiler and CommandLineInterface needed handlers for the
new UnimplementedFeatureException, and some cases I had moved on to
the new exception were better treated as real internal compiler
errors.

* Standardize on "Unimplemented feature" message
2016-11-14 20:41:58 +00:00
Kevin Boxhoorn
97703ac6e4 Add import remapping documentation to solc --help
Derived from the docs found [here](https://solidity.readthedocs.io/en/develop/miscellaneous.html#using-the-commandline-compiler).
Fixes #1207.
2016-10-15 17:36:40 +11:00