From 8e5c4bf21dfd9cfaa8de35aef034bb32be290a48 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 1 Jun 2017 15:41:51 +0200 Subject: Add include file to forward-declare inline assembly structs. --- libsolidity/inlineasm/AsmAnalysis.h | 17 ++--------- libsolidity/inlineasm/AsmAnalysisInfo.h | 18 ++---------- libsolidity/inlineasm/AsmData.h | 23 +++------------ libsolidity/inlineasm/AsmDataForward.h | 52 +++++++++++++++++++++++++++++++++ libsolidity/inlineasm/AsmPrinter.h | 15 ++-------- libsolidity/inlineasm/AsmScopeFiller.h | 16 ++-------- 6 files changed, 64 insertions(+), 77 deletions(-) create mode 100644 libsolidity/inlineasm/AsmDataForward.h (limited to 'libsolidity') diff --git a/libsolidity/inlineasm/AsmAnalysis.h b/libsolidity/inlineasm/AsmAnalysis.h index 5cdf72b1..76d2eba1 100644 --- a/libsolidity/inlineasm/AsmAnalysis.h +++ b/libsolidity/inlineasm/AsmAnalysis.h @@ -26,6 +26,8 @@ #include +#include + #include #include @@ -39,21 +41,6 @@ class ErrorReporter; 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; - struct AsmAnalysisInfo; /** diff --git a/libsolidity/inlineasm/AsmAnalysisInfo.h b/libsolidity/inlineasm/AsmAnalysisInfo.h index a75413a2..bd3b28c4 100644 --- a/libsolidity/inlineasm/AsmAnalysisInfo.h +++ b/libsolidity/inlineasm/AsmAnalysisInfo.h @@ -20,6 +20,8 @@ #pragma once +#include + #include #include @@ -33,24 +35,8 @@ namespace solidity 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; -using Statement = boost::variant; - struct AsmAnalysisInfo { using StackHeightInfo = std::map; diff --git a/libsolidity/inlineasm/AsmData.h b/libsolidity/inlineasm/AsmData.h index c2458bd7..db5840bc 100644 --- a/libsolidity/inlineasm/AsmData.h +++ b/libsolidity/inlineasm/AsmData.h @@ -22,10 +22,13 @@ #pragma once -#include +#include + #include #include +#include + namespace dev { namespace solidity @@ -38,24 +41,6 @@ using Type = std::string; struct TypedName { SourceLocation location; std::string name; Type type; }; using TypedNameList = std::vector; -/// 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; - /// Direct EVM instruction (except PUSHi and JUMPDEST) struct Instruction { SourceLocation location; solidity::Instruction instruction; }; /// Literal number or string (up to 32 bytes) diff --git a/libsolidity/inlineasm/AsmDataForward.h b/libsolidity/inlineasm/AsmDataForward.h new file mode 100644 index 00000000..4ead7ff5 --- /dev/null +++ b/libsolidity/inlineasm/AsmDataForward.h @@ -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 . +*/ +/** + * @author Christian + * @date 2016 + * Forward declaration of classes for inline assembly / JULIA AST + */ + +#pragma once + +#include + +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; + +} +} +} diff --git a/libsolidity/inlineasm/AsmPrinter.h b/libsolidity/inlineasm/AsmPrinter.h index 8808b058..f57dddc8 100644 --- a/libsolidity/inlineasm/AsmPrinter.h +++ b/libsolidity/inlineasm/AsmPrinter.h @@ -22,6 +22,8 @@ #pragma once +#include + #include namespace dev @@ -30,19 +32,6 @@ namespace solidity { 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 { diff --git a/libsolidity/inlineasm/AsmScopeFiller.h b/libsolidity/inlineasm/AsmScopeFiller.h index f04352c9..80c03d2c 100644 --- a/libsolidity/inlineasm/AsmScopeFiller.h +++ b/libsolidity/inlineasm/AsmScopeFiller.h @@ -20,6 +20,8 @@ #pragma once +#include + #include #include @@ -35,20 +37,6 @@ namespace assembly { 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 AsmAnalysisInfo; -- cgit