Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
clonker committed Jul 24, 2024
1 parent 6c4522a commit 3e8d654
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions libsolidity/codegen/CompilerContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ void CompilerContext::appendInlineAssembly(
{
// Store as generated sources, but first re-parse to update the source references.
solAssert(m_generatedYulUtilityCode.empty(), "");
m_generatedYulUtilityCode = yul::AsmPrinter(yul::AsmPrinter::Mode::OmitDefaultType, dialect)(obj.code->block());
std::string code = yul::AsmPrinter{yul::AsmPrinter::Mode::OmitDefaultType, dialect}(obj.code->block());
m_generatedYulUtilityCode = yul::AsmPrinter(yul::AsmPrinter::Mode::OmitDefaultType, nameRepository)(obj.code->block());
std::string code = yul::AsmPrinter{yul::AsmPrinter::Mode::OmitDefaultType, nameRepository }(obj.code->block());
langutil::CharStream charStream(m_generatedYulUtilityCode, _sourceName);
obj.code = yul::Parser(errorReporter, dialect).parse(charStream);
*obj.analysisInfo = yul::AsmAnalyzer::analyzeStrictAssertCorrect(obj);
Expand Down
4 changes: 2 additions & 2 deletions libyul/AsmAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ AsmAnalyzer::AsmAnalyzer(
langutil::ErrorReporter& _errorReporter,
YulNameRepository const& _nameRepository,
ExternalIdentifierAccess::Resolver _resolver,
std::set<YulString> _dataNames
std::set<std::string> _dataNames
):
m_resolver(std::move(_resolver)),
m_info(_analysisInfo),
Expand Down Expand Up @@ -109,7 +109,7 @@ AsmAnalysisInfo AsmAnalyzer::analyzeStrictAssertCorrect(Object const& _object)
AsmAnalysisInfo AsmAnalyzer::analyzeStrictAssertCorrect(
YulNameRepository const& _nameRepository,
Block const& _block,
std::set<YulString> const& _qualifiedDataNames)
std::set<std::string> const& _qualifiedDataNames)
{
ErrorList errorList;
langutil::ErrorReporter errors(errorList);
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class AsmAnalyzer
static AsmAnalysisInfo analyzeStrictAssertCorrect(
YulNameRepository const& _nameRepository,
Block const& _block,
std::set<YulString> const& _qualifiedDataNames
std::set<std::string> const& _qualifiedDataNames
);

std::vector<YulName> operator()(Literal const& _literal);
Expand Down
14 changes: 7 additions & 7 deletions libyul/YulName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ YulNameRepository::BuiltinFunction const* YulNameRepository::storageStoreFunctio
return fetchTypedPredefinedFunction(_type, m_predefinedBuiltinFunctions.storageStoreFunctions);
}

YulName YulNameRepository::hashFunction(YulName const _type) const
YulNameRepository::YulName YulNameRepository::hashFunction(YulName const _type) const
{
yulAssert(nameWithinBounds(_type), "Type exceeds repository size, probably stems from another instance.");
auto const typeIndex = indexOfType(_type);
Expand All @@ -253,7 +253,7 @@ YulNameRepository::BuiltinFunction YulNameRepository::convertBuiltinFunction(Yul
return result;
}

YulName YulNameRepository::nameOfLabel(std::string_view const label) const
YulNameRepository::YulName YulNameRepository::nameOfLabel(std::string_view const label) const
{
auto const it = std::find(m_definedLabels.begin(), m_definedLabels.end(), label);
if (it != m_definedLabels.end())
Expand All @@ -270,15 +270,15 @@ YulName YulNameRepository::nameOfLabel(std::string_view const label) const
return emptyName();
}

YulName YulNameRepository::nameOfBuiltin(std::string_view const builtin) const
YulNameRepository::YulName YulNameRepository::nameOfBuiltin(std::string_view const builtin) const
{
for (size_t i = m_indexBoundaries.beginBuiltins; i < m_indexBoundaries.endBuiltins; ++i)
if (baseLabelOf(std::get<0>(m_names[i])) == builtin)
return i;
return emptyName();
}

YulName YulNameRepository::nameOfType(std::string_view const _type) const
YulNameRepository::YulName YulNameRepository::nameOfType(std::string_view const _type) const
{
if (!m_dialectTypes.empty())
{
Expand Down Expand Up @@ -311,7 +311,7 @@ bool YulNameRepository::isVerbatimFunction(YulName const _name) const
return baseNameOf(_name) == predefined().verbatim;
}

YulName YulNameRepository::defineName(std::string_view const _label)
YulNameRepository::YulName YulNameRepository::defineName(std::string_view const _label)
{
if (auto const* builtin = m_dialect.get().builtin(YulString(std::string(_label))))
{
Expand Down Expand Up @@ -350,14 +350,14 @@ YulName YulNameRepository::defineName(std::string_view const _label)
}
}

YulName YulNameRepository::deriveName(YulName const _name)
YulNameRepository::YulName YulNameRepository::deriveName(YulName const _name)
{
yulAssert(nameWithinBounds(_name), "YulName exceeds repository size, probably stems from another instance.");
m_names.emplace_back(_name, YulNameState::DERIVED);
return m_index++;
}

YulName YulNameRepository::addGhost()
YulNameRepository::YulName YulNameRepository::addGhost()
{
return defineName(fmt::format(FMT_COMPILE("GHOST[{}]"), m_nGhosts++));
}
Expand Down

0 comments on commit 3e8d654

Please sign in to comment.