Code generator for external function calls.

This commit is contained in:
chriseth
2019-05-09 18:55:12 +02:00
parent 8e3d394803
commit e047c8d4d9
6 changed files with 249 additions and 3 deletions
@@ -64,10 +64,22 @@ public:
bool visit(Literal const& _literal) override;
private:
/// Appends code to call an external function with the given arguments.
/// All involved expressions have already been visited.
void appendExternalFunctionCall(
FunctionCall const& _functionCall,
std::vector<ASTPointer<Expression const>> const& _arguments
);
std::string fetchFreeMem() const;
/// @returns a Yul expression representing the current value of @a _expression,
/// converted to type @a _to if it does not yet have that type.
std::string expressionAsType(Expression const& _expression, Type const& _to);
std::ostream& defineExpression(Expression const& _expression);
/// Defines only one of many variables corresponding to an expression.
/// We start counting at 1 instead of 0.
std::ostream& defineExpressionPart(Expression const& _expression, size_t _part);
void appendAndOrOperatorCode(BinaryOperation const& _binOp);