mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Emit immutable references for pure yul code
This commit is contained in:
@@ -1461,36 +1461,36 @@ Json::Value StandardCompiler::compileYul(InputsAndSettings _inputsAndSettings)
|
||||
stack.optimize();
|
||||
|
||||
MachineAssemblyObject object;
|
||||
MachineAssemblyObject runtimeObject;
|
||||
tie(object, runtimeObject) = stack.assembleWithDeployed();
|
||||
MachineAssemblyObject deployedObject;
|
||||
tie(object, deployedObject) = stack.assembleWithDeployed();
|
||||
|
||||
if (object.bytecode)
|
||||
object.bytecode->link(_inputsAndSettings.libraries);
|
||||
if (runtimeObject.bytecode)
|
||||
runtimeObject.bytecode->link(_inputsAndSettings.libraries);
|
||||
if (deployedObject.bytecode)
|
||||
deployedObject.bytecode->link(_inputsAndSettings.libraries);
|
||||
|
||||
for (string const& objectKind: vector<string>{"bytecode", "deployedBytecode"})
|
||||
for (auto&& [kind, isDeployed]: {make_pair("bytecode"s, false), make_pair("deployedBytecode"s, true)})
|
||||
if (isArtifactRequested(
|
||||
_inputsAndSettings.outputSelection,
|
||||
sourceName,
|
||||
contractName,
|
||||
evmObjectComponents(objectKind),
|
||||
evmObjectComponents(kind),
|
||||
wildcardMatchesExperimental
|
||||
))
|
||||
{
|
||||
MachineAssemblyObject const& o = objectKind == "bytecode" ? object : runtimeObject;
|
||||
MachineAssemblyObject const& o = isDeployed ? deployedObject : object;
|
||||
if (o.bytecode)
|
||||
output["contracts"][sourceName][contractName]["evm"][objectKind] =
|
||||
output["contracts"][sourceName][contractName]["evm"][kind] =
|
||||
collectEVMObject(
|
||||
*o.bytecode,
|
||||
o.sourceMappings.get(),
|
||||
Json::arrayValue,
|
||||
false,
|
||||
[&](string const& _element) { return isArtifactRequested(
|
||||
isDeployed,
|
||||
[&, kind = kind](string const& _element) { return isArtifactRequested(
|
||||
_inputsAndSettings.outputSelection,
|
||||
sourceName,
|
||||
contractName,
|
||||
"evm." + objectKind + "." + _element,
|
||||
"evm." + kind + "." + _element,
|
||||
wildcardMatchesExperimental
|
||||
); }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user