mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add include file to forward-declare inline assembly structs.
This commit is contained in:
parent
49b1112117
commit
8e5c4bf21d
@ -21,6 +21,7 @@
|
|||||||
#include <libjulia/backends/evm/EVMAssembly.h>
|
#include <libjulia/backends/evm/EVMAssembly.h>
|
||||||
|
|
||||||
#include <libsolidity/inlineasm/AsmScope.h>
|
#include <libsolidity/inlineasm/AsmScope.h>
|
||||||
|
#include <libsolidity/inlineasm/AsmDataForward.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <libjulia/backends/evm/AbstractAssembly.h>
|
#include <libjulia/backends/evm/AbstractAssembly.h>
|
||||||
|
|
||||||
|
#include <libsolidity/inlineasm/AsmDataForward.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -39,21 +41,6 @@ class ErrorReporter;
|
|||||||
namespace assembly
|
namespace assembly
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Literal;
|
|
||||||
struct Block;
|
|
||||||
struct Label;
|
|
||||||
struct FunctionalInstruction;
|
|
||||||
struct Assignment;
|
|
||||||
struct VariableDeclaration;
|
|
||||||
struct Instruction;
|
|
||||||
struct Identifier;
|
|
||||||
struct StackAssignment;
|
|
||||||
struct FunctionDefinition;
|
|
||||||
struct FunctionCall;
|
|
||||||
struct Switch;
|
|
||||||
struct ForLoop;
|
|
||||||
using Statement = boost::variant<Instruction, Literal, Label, StackAssignment, Identifier, Assignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Switch, Block, ForLoop>;
|
|
||||||
|
|
||||||
struct AsmAnalysisInfo;
|
struct AsmAnalysisInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <libsolidity/inlineasm/AsmDataForward.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -33,24 +35,8 @@ namespace solidity
|
|||||||
namespace assembly
|
namespace assembly
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Literal;
|
|
||||||
struct Block;
|
|
||||||
struct Label;
|
|
||||||
struct FunctionalInstruction;
|
|
||||||
struct Assignment;
|
|
||||||
struct VariableDeclaration;
|
|
||||||
struct Instruction;
|
|
||||||
struct Identifier;
|
|
||||||
struct StackAssignment;
|
|
||||||
struct FunctionDefinition;
|
|
||||||
struct FunctionCall;
|
|
||||||
struct Switch;
|
|
||||||
struct ForLoop;
|
|
||||||
|
|
||||||
struct Scope;
|
struct Scope;
|
||||||
|
|
||||||
using Statement = boost::variant<Instruction, Literal, Label, StackAssignment, Identifier, Assignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Switch, ForLoop, Block>;
|
|
||||||
|
|
||||||
struct AsmAnalysisInfo
|
struct AsmAnalysisInfo
|
||||||
{
|
{
|
||||||
using StackHeightInfo = std::map<void const*, int>;
|
using StackHeightInfo = std::map<void const*, int>;
|
||||||
|
@ -22,10 +22,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <libsolidity/inlineasm/AsmDataForward.h>
|
||||||
|
|
||||||
#include <libevmasm/Instruction.h>
|
#include <libevmasm/Instruction.h>
|
||||||
#include <libevmasm/SourceLocation.h>
|
#include <libevmasm/SourceLocation.h>
|
||||||
|
|
||||||
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
namespace dev
|
namespace dev
|
||||||
{
|
{
|
||||||
namespace solidity
|
namespace solidity
|
||||||
@ -38,24 +41,6 @@ using Type = std::string;
|
|||||||
struct TypedName { SourceLocation location; std::string name; Type type; };
|
struct TypedName { SourceLocation location; std::string name; Type type; };
|
||||||
using TypedNameList = std::vector<TypedName>;
|
using TypedNameList = std::vector<TypedName>;
|
||||||
|
|
||||||
/// What follows are the AST nodes for assembly.
|
|
||||||
|
|
||||||
struct Instruction;
|
|
||||||
struct Literal;
|
|
||||||
struct Label;
|
|
||||||
struct StackAssignment;
|
|
||||||
struct Identifier;
|
|
||||||
struct Assignment;
|
|
||||||
struct VariableDeclaration;
|
|
||||||
struct FunctionalInstruction;
|
|
||||||
struct FunctionDefinition;
|
|
||||||
struct FunctionCall;
|
|
||||||
struct Switch;
|
|
||||||
struct ForLoop;
|
|
||||||
struct Block;
|
|
||||||
|
|
||||||
using Statement = boost::variant<Instruction, Literal, Label, StackAssignment, Identifier, Assignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Switch, ForLoop, Block>;
|
|
||||||
|
|
||||||
/// Direct EVM instruction (except PUSHi and JUMPDEST)
|
/// Direct EVM instruction (except PUSHi and JUMPDEST)
|
||||||
struct Instruction { SourceLocation location; solidity::Instruction instruction; };
|
struct Instruction { SourceLocation location; solidity::Instruction instruction; };
|
||||||
/// Literal number or string (up to 32 bytes)
|
/// Literal number or string (up to 32 bytes)
|
||||||
|
52
libsolidity/inlineasm/AsmDataForward.h
Normal file
52
libsolidity/inlineasm/AsmDataForward.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
This file is part of solidity.
|
||||||
|
|
||||||
|
solidity is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
solidity is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author Christian <c@ethdev.com>
|
||||||
|
* @date 2016
|
||||||
|
* Forward declaration of classes for inline assembly / JULIA AST
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
|
namespace dev
|
||||||
|
{
|
||||||
|
namespace solidity
|
||||||
|
{
|
||||||
|
namespace assembly
|
||||||
|
{
|
||||||
|
|
||||||
|
struct Instruction;
|
||||||
|
struct Literal;
|
||||||
|
struct Label;
|
||||||
|
struct StackAssignment;
|
||||||
|
struct Identifier;
|
||||||
|
struct Assignment;
|
||||||
|
struct VariableDeclaration;
|
||||||
|
struct FunctionalInstruction;
|
||||||
|
struct FunctionDefinition;
|
||||||
|
struct FunctionCall;
|
||||||
|
struct Switch;
|
||||||
|
struct ForLoop;
|
||||||
|
struct Block;
|
||||||
|
|
||||||
|
using Statement = boost::variant<Instruction, Literal, Label, StackAssignment, Identifier, Assignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Switch, ForLoop, Block>;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <libsolidity/inlineasm/AsmDataForward.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
namespace dev
|
namespace dev
|
||||||
@ -30,19 +32,6 @@ namespace solidity
|
|||||||
{
|
{
|
||||||
namespace assembly
|
namespace assembly
|
||||||
{
|
{
|
||||||
struct Instruction;
|
|
||||||
struct Literal;
|
|
||||||
struct Identifier;
|
|
||||||
struct FunctionalInstruction;
|
|
||||||
struct Label;
|
|
||||||
struct StackAssignment;
|
|
||||||
struct Assignment;
|
|
||||||
struct VariableDeclaration;
|
|
||||||
struct FunctionDefinition;
|
|
||||||
struct FunctionCall;
|
|
||||||
struct Switch;
|
|
||||||
struct ForLoop;
|
|
||||||
struct Block;
|
|
||||||
|
|
||||||
class AsmPrinter: public boost::static_visitor<std::string>
|
class AsmPrinter: public boost::static_visitor<std::string>
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <libsolidity/inlineasm/AsmDataForward.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -35,20 +37,6 @@ namespace assembly
|
|||||||
{
|
{
|
||||||
|
|
||||||
struct TypedName;
|
struct TypedName;
|
||||||
struct Literal;
|
|
||||||
struct Block;
|
|
||||||
struct Label;
|
|
||||||
struct FunctionalInstruction;
|
|
||||||
struct Assignment;
|
|
||||||
struct VariableDeclaration;
|
|
||||||
struct Instruction;
|
|
||||||
struct Identifier;
|
|
||||||
struct StackAssignment;
|
|
||||||
struct FunctionDefinition;
|
|
||||||
struct FunctionCall;
|
|
||||||
struct Switch;
|
|
||||||
struct ForLoop;
|
|
||||||
|
|
||||||
struct Scope;
|
struct Scope;
|
||||||
struct AsmAnalysisInfo;
|
struct AsmAnalysisInfo;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user