aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/FullInliner.h
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/optimiser/FullInliner.h')
-rw-r--r--libyul/optimiser/FullInliner.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/libyul/optimiser/FullInliner.h b/libyul/optimiser/FullInliner.h
index 5ecfb57a..66ce8e2f 100644
--- a/libyul/optimiser/FullInliner.h
+++ b/libyul/optimiser/FullInliner.h
@@ -77,23 +77,23 @@ public:
/// Inlining heuristic.
/// @param _callSite the name of the function in which the function call is located.
- bool shallInline(FunctionCall const& _funCall, std::string const& _callSite);
+ bool shallInline(FunctionCall const& _funCall, YulString _callSite);
- FunctionDefinition& function(std::string _name) { return *m_functions.at(_name); }
+ FunctionDefinition& function(YulString _name) { return *m_functions.at(_name); }
private:
void updateCodeSize(FunctionDefinition& fun);
- void handleBlock(std::string const& _currentFunctionName, Block& _block);
+ void handleBlock(YulString _currentFunctionName, Block& _block);
/// The AST to be modified. The root block itself will not be modified, because
/// we store pointers to functions.
Block& m_ast;
- std::map<std::string, FunctionDefinition*> m_functions;
+ std::map<YulString, FunctionDefinition*> m_functions;
/// Names of functions to always inline.
- std::set<std::string> m_alwaysInline;
+ std::set<YulString> m_alwaysInline;
/// Variables that are constants (used for inlining heuristic)
- std::set<std::string> m_constants;
- std::map<std::string, size_t> m_functionSizes;
+ std::set<YulString> m_constants;
+ std::map<YulString, size_t> m_functionSizes;
NameDispenser& m_nameDispenser;
};
@@ -104,7 +104,7 @@ private:
class InlineModifier: public ASTModifier
{
public:
- InlineModifier(FullInliner& _driver, NameDispenser& _nameDispenser, std::string _functionName):
+ InlineModifier(FullInliner& _driver, NameDispenser& _nameDispenser, YulString _functionName):
m_currentFunction(std::move(_functionName)),
m_driver(_driver),
m_nameDispenser(_nameDispenser)
@@ -116,7 +116,7 @@ private:
boost::optional<std::vector<Statement>> tryInlineStatement(Statement& _statement);
std::vector<Statement> performInline(Statement& _statement, FunctionCall& _funCall);
- std::string m_currentFunction;
+ YulString m_currentFunction;
FullInliner& m_driver;
NameDispenser& m_nameDispenser;
};
@@ -131,8 +131,8 @@ class BodyCopier: public ASTCopier
public:
BodyCopier(
NameDispenser& _nameDispenser,
- std::string const& _varNamePrefix,
- std::map<std::string, std::string> const& _variableReplacements
+ YulString _varNamePrefix,
+ std::map<YulString, YulString> const& _variableReplacements
):
m_nameDispenser(_nameDispenser),
m_varNamePrefix(_varNamePrefix),
@@ -144,11 +144,11 @@ public:
virtual Statement operator()(VariableDeclaration const& _varDecl) override;
virtual Statement operator()(FunctionDefinition const& _funDef) override;
- virtual std::string translateIdentifier(std::string const& _name) override;
+ virtual YulString translateIdentifier(YulString _name) override;
NameDispenser& m_nameDispenser;
- std::string const& m_varNamePrefix;
- std::map<std::string, std::string> m_variableReplacements;
+ YulString m_varNamePrefix;
+ std::map<YulString, YulString> m_variableReplacements;
};