Mark viaIR code generation as non-experimental.

This commit is contained in:
Daniel Kirchner
2022-03-14 14:48:00 +01:00
parent 3f6beaa0ad
commit e58c0b561d
48 changed files with 63 additions and 407 deletions
+2 -10
View File
@@ -93,7 +93,7 @@ pair<string, string> IRGenerator::run(
map<ContractDefinition const*, string_view const> const& _otherYulSources
)
{
string const ir = yul::reindent(generate(_contract, _cborMetadata, _otherYulSources));
string ir = yul::reindent(generate(_contract, _cborMetadata, _otherYulSources));
yul::AssemblyStack asmStack(
m_evmVersion,
@@ -113,15 +113,7 @@ pair<string, string> IRGenerator::run(
}
asmStack.optimize();
string warning =
"/*=====================================================*\n"
" * WARNING *\n"
" * Solidity to Yul compilation is still EXPERIMENTAL *\n"
" * It can result in LOSS OF FUNDS or worse *\n"
" * !USE AT YOUR OWN RISK! *\n"
" *=====================================================*/\n\n";
return {warning + ir, warning + asmStack.print(m_context.soliditySourceProvider())};
return {move(ir), asmStack.print(m_context.soliditySourceProvider())};
}
string IRGenerator::generate(
+1 -1
View File
@@ -1677,7 +1677,7 @@ bytes CompilerStack::createCBORMetadata(Contract const& _contract, bool _forIR)
else
solAssert(m_metadataHash == MetadataHash::None, "Invalid metadata hash");
if (experimentalMode || _forIR)
if (experimentalMode)
encoder.pushBool("experimental", true);
if (m_metadataFormat == MetadataFormat::WithReleaseVersionTag)
encoder.pushBytes("solc", VersionCompactBytes);
+4 -5
View File
@@ -189,7 +189,7 @@ public:
/// Enable EVM Bytecode generation. This is enabled by default.
void enableEvmBytecodeGeneration(bool _enable = true) { m_generateEvmBytecode = _enable; }
/// Enable experimental generation of Yul IR code.
/// Enable generation of Yul IR code.
void enableIRGeneration(bool _enable = true) { m_generateIR = _enable; }
/// Enable experimental generation of Ewasm code. If enabled, IR is also generated.
@@ -373,8 +373,8 @@ private:
std::shared_ptr<evmasm::Assembly> evmRuntimeAssembly;
evmasm::LinkerObject object; ///< Deployment object (includes the runtime sub-object).
evmasm::LinkerObject runtimeObject; ///< Runtime object.
std::string yulIR; ///< Experimental Yul IR code.
std::string yulIROptimized; ///< Optimized experimental Yul IR code.
std::string yulIR; ///< Yul IR code.
std::string yulIROptimized; ///< Optimized Yul IR code.
std::string ewasm; ///< Experimental Ewasm text representation
evmasm::LinkerObject ewasmObject; ///< Experimental Ewasm code
util::LazyInit<std::string const> metadata; ///< The metadata json that will be hashed into the chain.
@@ -447,8 +447,7 @@ private:
/// Can only be called after state is SourcesSet.
Source const& source(std::string const& _sourceName) const;
/// @param _forIR If true, include a flag that indicates that the bytecode comes from the
/// experimental IR codegen.
/// @param _forIR If true, include a flag that indicates that the bytecode comes from IR codegen.
/// @returns the metadata JSON as a compact string for the given contract.
std::string createMetadata(Contract const& _contract, bool _forIR) const;