From 5b73c2ae3bce09442572b5401a7bcccc2ffe7590 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 20 Dec 2018 17:22:17 +0100 Subject: Take special functions that require literals into account. --- libyul/optimiser/ExpressionSplitter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libyul/optimiser/ExpressionSplitter.cpp') diff --git a/libyul/optimiser/ExpressionSplitter.cpp b/libyul/optimiser/ExpressionSplitter.cpp index a3b2dc11..334e33f4 100644 --- a/libyul/optimiser/ExpressionSplitter.cpp +++ b/libyul/optimiser/ExpressionSplitter.cpp @@ -24,6 +24,7 @@ #include #include +#include #include @@ -43,6 +44,11 @@ void ExpressionSplitter::operator()(FunctionalInstruction& _instruction) void ExpressionSplitter::operator()(FunctionCall& _funCall) { + if (BuiltinFunction const* builtin = m_dialect.builtin(_funCall.functionName.name)) + if (builtin->literalArguments) + // We cannot outline function arguments that have to be literals + return; + for (auto& arg: _funCall.arguments | boost::adaptors::reversed) outlineExpression(arg); } -- cgit