This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 795
feat(solc): yul compilation #994
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4cb05fd
added yul compilation
0xc0drr 061695a
fix doctest
0xc0drr 3e31463
fixes
0xc0drr 964ef41
changelog
0xc0drr 01500f1
cleanup
0xc0drr 773f27e
fmt
0xc0drr 5d4128a
test update
0xc0drr 9368924
lint
0xc0drr a707297
ci fix
0xc0drr b0ca6e1
Merge branch 'master' into feature/yul_compilation
gakonst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.6.6; | ||
|
||
contract Dapp { | ||
|
||
function modified() public {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
object "SimpleStore" { | ||
code { | ||
datacopy(0, dataoffset("Runtime"), datasize("Runtime")) | ||
return(0, datasize("Runtime")) | ||
} | ||
object "Runtime" { | ||
code { | ||
calldatacopy(0, 0, 36) // write calldata to memory | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this returns at most
vec![sol, yul]
can we add something like this perhaps
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
CompilerInput
abstraction is correct right now - i.e. it's the unit that get's fed into solc compiler. Thewith_sources
method though doesn't work because if sources have different types that means that you'll have 2 compiler inputs the needs to be fed into solc sequentially. So to me the signature looks good. Plus the vec is extensible for other sources (if any :))To be 100% clean we could update the
new
method so it's just a plain constructor taking language as an input. For that method it's really uncommon to return aVec
. I just left it as it is for now because it could be used in many places.Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, however working with a
Vec<CompilerInput>
can be a bit annoying.Should be fine for now, but I think we can make this more ergonomic with
ProjectCompilerInput
which requires some refactoring, which we should leave for a follow up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with this as-is, seems good enough for now!