From d5f8ce90c7a76870e5a9d0fe6f9fd709a7383572 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 21 Jun 2017 21:50:57 +0100 Subject: [PATCH] Merge interface/Exceptions and interface/Utils --- libjulia/backends/evm/EVMAssembly.cpp | 2 +- libjulia/backends/evm/EVMCodeTransform.cpp | 2 +- libsolidity/ast/AST.cpp | 2 - libsolidity/ast/AST.h | 1 - libsolidity/ast/ASTJsonConverter.cpp | 1 - libsolidity/ast/ASTJsonConverter.h | 1 - libsolidity/ast/Types.cpp | 1 - libsolidity/codegen/ArrayUtils.cpp | 2 +- libsolidity/codegen/ExpressionCompiler.cpp | 1 + libsolidity/codegen/ExpressionCompiler.h | 2 +- libsolidity/inlineasm/AsmAnalysis.cpp | 1 - libsolidity/inlineasm/AsmPrinter.cpp | 2 +- libsolidity/inlineasm/AsmScopeFiller.cpp | 2 +- libsolidity/interface/Exceptions.cpp | 1 - libsolidity/interface/Exceptions.h | 11 ++++++ libsolidity/interface/Utils.h | 45 ---------------------- libsolidity/interface/Version.cpp | 2 +- libsolidity/parsing/DocStringParser.cpp | 2 +- libsolidity/parsing/Scanner.cpp | 2 +- libsolidity/parsing/Token.h | 1 - 20 files changed, 21 insertions(+), 63 deletions(-) delete mode 100644 libsolidity/interface/Utils.h diff --git a/libjulia/backends/evm/EVMAssembly.cpp b/libjulia/backends/evm/EVMAssembly.cpp index daca2393c..7ec26957c 100644 --- a/libjulia/backends/evm/EVMAssembly.cpp +++ b/libjulia/backends/evm/EVMAssembly.cpp @@ -22,7 +22,7 @@ #include -#include +#include using namespace std; using namespace dev; diff --git a/libjulia/backends/evm/EVMCodeTransform.cpp b/libjulia/backends/evm/EVMCodeTransform.cpp index b231ececc..8f12bc25b 100644 --- a/libjulia/backends/evm/EVMCodeTransform.cpp +++ b/libjulia/backends/evm/EVMCodeTransform.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 03112d2d9..40dfa348d 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -20,10 +20,8 @@ * Solidity abstract syntax tree. */ -#include #include #include -#include #include #include diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index ba1d05899..835726921 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 4ad1f9629..a90debb26 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/libsolidity/ast/ASTJsonConverter.h b/libsolidity/ast/ASTJsonConverter.h index c2de5c482..27114c2a2 100644 --- a/libsolidity/ast/ASTJsonConverter.h +++ b/libsolidity/ast/ASTJsonConverter.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index cfee041ec..bd3346f9f 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -22,7 +22,6 @@ #include -#include #include #include diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp index 6a641b026..67ca22f14 100644 --- a/libsolidity/codegen/ArrayUtils.cpp +++ b/libsolidity/codegen/ArrayUtils.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include using namespace std; diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 25154bc03..03bba80c6 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -32,6 +32,7 @@ #include #include #include + using namespace std; namespace dev diff --git a/libsolidity/codegen/ExpressionCompiler.h b/libsolidity/codegen/ExpressionCompiler.h index d0a8ac159..3b8cf1c62 100644 --- a/libsolidity/codegen/ExpressionCompiler.h +++ b/libsolidity/codegen/ExpressionCompiler.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include namespace dev { namespace eth diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 2891ec95a..b0d044ae3 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/libsolidity/inlineasm/AsmPrinter.cpp b/libsolidity/inlineasm/AsmPrinter.cpp index 0d06fedd5..062ff4531 100644 --- a/libsolidity/inlineasm/AsmPrinter.cpp +++ b/libsolidity/inlineasm/AsmPrinter.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/libsolidity/inlineasm/AsmScopeFiller.cpp b/libsolidity/inlineasm/AsmScopeFiller.cpp index 3bef9cec9..5b3174b86 100644 --- a/libsolidity/inlineasm/AsmScopeFiller.cpp +++ b/libsolidity/inlineasm/AsmScopeFiller.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include diff --git a/libsolidity/interface/Exceptions.cpp b/libsolidity/interface/Exceptions.cpp index c09180de4..deee92aa3 100644 --- a/libsolidity/interface/Exceptions.cpp +++ b/libsolidity/interface/Exceptions.cpp @@ -21,7 +21,6 @@ */ #include -#include using namespace std; using namespace dev; diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h index 0803d8cce..5fdb8f11e 100644 --- a/libsolidity/interface/Exceptions.h +++ b/libsolidity/interface/Exceptions.h @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace dev @@ -39,6 +40,16 @@ struct InternalCompilerError: virtual Exception {}; struct FatalError: virtual Exception {}; struct UnimplementedFeatureError: virtual Exception{}; +/// Assertion that throws an InternalCompilerError containing the given description if it is not met. +#define solAssert(CONDITION, DESCRIPTION) \ + assertThrow(CONDITION, ::dev::solidity::InternalCompilerError, DESCRIPTION) + +#define solUnimplementedAssert(CONDITION, DESCRIPTION) \ + assertThrow(CONDITION, ::dev::solidity::UnimplementedFeatureError, DESCRIPTION) + +#define solUnimplemented(DESCRIPTION) \ + solUnimplementedAssert(false, DESCRIPTION) + class Error: virtual public Exception { public: diff --git a/libsolidity/interface/Utils.h b/libsolidity/interface/Utils.h deleted file mode 100644 index 0027759cc..000000000 --- a/libsolidity/interface/Utils.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - 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 2014 - * Solidity Utilities. - */ - -#pragma once - -#include -#include - -namespace dev -{ -namespace solidity -{ -struct InternalCompilerError; -struct UnimplementedFeatureError; -} -} - -/// Assertion that throws an InternalCompilerError containing the given description if it is not met. -#define solAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, ::dev::solidity::InternalCompilerError, DESCRIPTION) - -#define solUnimplementedAssert(CONDITION, DESCRIPTION) \ - assertThrow(CONDITION, ::dev::solidity::UnimplementedFeatureError, DESCRIPTION) - -#define solUnimplemented(DESCRIPTION) \ - solUnimplementedAssert(false, DESCRIPTION) diff --git a/libsolidity/interface/Version.cpp b/libsolidity/interface/Version.cpp index 0d23f9c3d..a35bfd294 100644 --- a/libsolidity/interface/Version.cpp +++ b/libsolidity/interface/Version.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include using namespace dev; diff --git a/libsolidity/parsing/DocStringParser.cpp b/libsolidity/parsing/DocStringParser.cpp index cd6c1d8af..0409de720 100644 --- a/libsolidity/parsing/DocStringParser.cpp +++ b/libsolidity/parsing/DocStringParser.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include diff --git a/libsolidity/parsing/Scanner.cpp b/libsolidity/parsing/Scanner.cpp index 0e60fd0bf..fdca23ea1 100644 --- a/libsolidity/parsing/Scanner.cpp +++ b/libsolidity/parsing/Scanner.cpp @@ -52,7 +52,7 @@ #include #include -#include +#include #include using namespace std; diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 9a557ebd0..39c0eff99 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -43,7 +43,6 @@ #pragma once #include -#include #include #include