aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-11-26 19:44:25 +0800
committerGitHub <noreply@github.com>2018-11-26 19:44:25 +0800
commit0b474d52994028392402ca1e7f56b613ab365dec (patch)
tree86b2096c12771148d49fe9cb468531b7d6d1610a
parentbc137c2eeb6920cf33eea1ceaab49df3dfddad07 (diff)
parentaeb66905de3f65ca7a63addb6c9d05108986dbeb (diff)
downloaddexon-solidity-0b474d52994028392402ca1e7f56b613ab365dec.tar.gz
dexon-solidity-0b474d52994028392402ca1e7f56b613ab365dec.tar.zst
dexon-solidity-0b474d52994028392402ca1e7f56b613ab365dec.zip
Merge pull request #5497 from ethereum/langutil-SourceReferenceFormatter
Moving SourceReferenceFormatter into langutil namespace.
-rw-r--r--liblangutil/SourceReferenceFormatter.cpp (renamed from libsolidity/interface/SourceReferenceFormatter.cpp)13
-rw-r--r--liblangutil/SourceReferenceFormatter.h (renamed from libsolidity/interface/SourceReferenceFormatter.h)19
-rw-r--r--libsolidity/codegen/CompilerContext.cpp2
-rw-r--r--libsolidity/interface/StandardCompiler.cpp2
-rw-r--r--solc/CommandLineInterface.cpp2
-rw-r--r--test/libsolidity/AnalysisFramework.cpp2
-rw-r--r--test/libsolidity/GasMeter.cpp2
-rw-r--r--test/libsolidity/SolidityExecutionFramework.h4
-rw-r--r--test/libyul/Common.cpp2
-rw-r--r--test/libyul/YulOptimizerTest.cpp2
-rw-r--r--test/tools/yulopti.cpp2
11 files changed, 19 insertions, 33 deletions
diff --git a/libsolidity/interface/SourceReferenceFormatter.cpp b/liblangutil/SourceReferenceFormatter.cpp
index d727afbe..58a65521 100644
--- a/libsolidity/interface/SourceReferenceFormatter.cpp
+++ b/liblangutil/SourceReferenceFormatter.cpp
@@ -20,18 +20,14 @@
* Formatting functions for errors referencing positions and locations in the source.
*/
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/Scanner.h>
#include <liblangutil/Exceptions.h>
using namespace std;
+using namespace dev;
using namespace langutil;
-namespace dev
-{
-namespace solidity
-{
-
void SourceReferenceFormatter::printSourceLocation(SourceLocation const* _location)
{
if (!_location || !_location->sourceName)
@@ -103,7 +99,7 @@ void SourceReferenceFormatter::printSourceName(SourceLocation const* _location)
}
void SourceReferenceFormatter::printExceptionInformation(
- Exception const& _exception,
+ dev::Exception const& _exception,
string const& _name
)
{
@@ -131,6 +127,3 @@ void SourceReferenceFormatter::printExceptionInformation(
m_stream << endl;
}
}
-
-}
-}
diff --git a/libsolidity/interface/SourceReferenceFormatter.h b/liblangutil/SourceReferenceFormatter.h
index 7dea5254..0ef3ca00 100644
--- a/libsolidity/interface/SourceReferenceFormatter.h
+++ b/liblangutil/SourceReferenceFormatter.h
@@ -26,21 +26,15 @@
#include <sstream>
#include <functional>
-namespace langutil
-{
-struct SourceLocation;
-class Scanner;
-}
-
namespace dev
{
-
struct Exception; // forward
+}
-namespace solidity
+namespace langutil
{
-
-class CompilerStack; // forward
+struct SourceLocation;
+class Scanner;
class SourceReferenceFormatter
{
@@ -57,10 +51,10 @@ public:
/// Prints source location if it is given.
void printSourceLocation(langutil::SourceLocation const* _location);
- void printExceptionInformation(Exception const& _exception, std::string const& _name);
+ void printExceptionInformation(dev::Exception const& _exception, std::string const& _name);
static std::string formatExceptionInformation(
- Exception const& _exception,
+ dev::Exception const& _exception,
std::string const& _name,
ScannerFromSourceNameFun const& _scannerFromSourceName
)
@@ -80,4 +74,3 @@ private:
};
}
-}
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp
index b4fad94f..2fd62de2 100644
--- a/libsolidity/codegen/CompilerContext.cpp
+++ b/libsolidity/codegen/CompilerContext.cpp
@@ -25,7 +25,7 @@
#include <libsolidity/ast/AST.h>
#include <libsolidity/codegen/Compiler.h>
#include <libsolidity/interface/Version.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <libyul/AsmParser.h>
#include <libyul/AsmCodeGen.h>
#include <libyul/AsmAnalysis.h>
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index bf33b789..4a32d9f3 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -21,7 +21,7 @@
*/
#include <libsolidity/interface/StandardCompiler.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <libsolidity/ast/ASTJsonConverter.h>
#include <libevmasm/Instruction.h>
#include <libdevcore/JSON.h>
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index b523f052..7f64d8ac 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -34,7 +34,7 @@
#include <liblangutil/Exceptions.h>
#include <libsolidity/interface/CompilerStack.h>
#include <libsolidity/interface/StandardCompiler.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <libsolidity/interface/GasEstimator.h>
#include <libsolidity/interface/AssemblyStack.h>
diff --git a/test/libsolidity/AnalysisFramework.cpp b/test/libsolidity/AnalysisFramework.cpp
index 12d63cb7..bd24115c 100644
--- a/test/libsolidity/AnalysisFramework.cpp
+++ b/test/libsolidity/AnalysisFramework.cpp
@@ -23,7 +23,7 @@
#include <test/Options.h>
#include <libsolidity/interface/CompilerStack.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <libsolidity/ast/AST.h>
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index 61f16c0f..601948bc 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -26,7 +26,7 @@
#include <libevmasm/PathGasMeter.h>
#include <libsolidity/ast/AST.h>
#include <libsolidity/interface/GasEstimator.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
using namespace std;
using namespace langutil;
diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h
index d43e994d..cedbf51a 100644
--- a/test/libsolidity/SolidityExecutionFramework.h
+++ b/test/libsolidity/SolidityExecutionFramework.h
@@ -28,7 +28,7 @@
#include <libsolidity/interface/CompilerStack.h>
#include <liblangutil/Exceptions.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
namespace dev
{
@@ -73,7 +73,7 @@ public:
if (!m_compiler.compile())
{
auto scannerFromSourceName = [&](std::string const& _sourceName) -> langutil::Scanner const& { return m_compiler.scanner(_sourceName); };
- SourceReferenceFormatter formatter(std::cerr, scannerFromSourceName);
+ langutil::SourceReferenceFormatter formatter(std::cerr, scannerFromSourceName);
for (auto const& error: m_compiler.errors())
formatter.printExceptionInformation(
diff --git a/test/libyul/Common.cpp b/test/libyul/Common.cpp
index d7785287..2e70d086 100644
--- a/test/libyul/Common.cpp
+++ b/test/libyul/Common.cpp
@@ -23,7 +23,7 @@
#include <test/Options.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <libyul/optimiser/Disambiguator.h>
#include <libyul/AsmParser.h>
diff --git a/test/libyul/YulOptimizerTest.cpp b/test/libyul/YulOptimizerTest.cpp
index 9c2da493..c857d8a5 100644
--- a/test/libyul/YulOptimizerTest.cpp
+++ b/test/libyul/YulOptimizerTest.cpp
@@ -43,7 +43,7 @@
#include <libyul/AsmPrinter.h>
#include <libyul/AsmParser.h>
#include <libyul/AsmAnalysis.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/ErrorReporter.h>
#include <liblangutil/Scanner.h>
diff --git a/test/tools/yulopti.cpp b/test/tools/yulopti.cpp
index 7a147137..5a8a5106 100644
--- a/test/tools/yulopti.cpp
+++ b/test/tools/yulopti.cpp
@@ -27,7 +27,7 @@
#include <libyul/AsmData.h>
#include <libyul/AsmParser.h>
#include <libyul/AsmPrinter.h>
-#include <libsolidity/interface/SourceReferenceFormatter.h>
+#include <liblangutil/SourceReferenceFormatter.h>
#include <libyul/optimiser/BlockFlattener.h>
#include <libyul/optimiser/Disambiguator.h>