aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ABIFunctions.h2
-rw-r--r--libsolidity/codegen/ArrayUtils.cpp3
-rw-r--r--libsolidity/codegen/Compiler.h2
-rw-r--r--libsolidity/codegen/CompilerContext.cpp8
-rw-r--r--libsolidity/codegen/CompilerContext.h2
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp1
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp3
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp1
-rw-r--r--libsolidity/codegen/ExpressionCompiler.h4
-rw-r--r--libsolidity/codegen/LValue.cpp1
-rw-r--r--libsolidity/codegen/LValue.h44
11 files changed, 39 insertions, 32 deletions
diff --git a/libsolidity/codegen/ABIFunctions.h b/libsolidity/codegen/ABIFunctions.h
index e9ffe4fb..d2132258 100644
--- a/libsolidity/codegen/ABIFunctions.h
+++ b/libsolidity/codegen/ABIFunctions.h
@@ -22,7 +22,7 @@
#pragma once
-#include <libsolidity/interface/EVMVersion.h>
+#include <liblangutil/EVMVersion.h>
#include <libsolidity/ast/ASTForward.h>
diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp
index d33f749c..4878f9f3 100644
--- a/libsolidity/codegen/ArrayUtils.cpp
+++ b/libsolidity/codegen/ArrayUtils.cpp
@@ -25,11 +25,12 @@
#include <libsolidity/codegen/CompilerContext.h>
#include <libsolidity/codegen/CompilerUtils.h>
#include <libsolidity/ast/Types.h>
-#include <libsolidity/interface/Exceptions.h>
+#include <liblangutil/Exceptions.h>
#include <libsolidity/codegen/LValue.h>
using namespace std;
using namespace dev;
+using namespace langutil;
using namespace solidity;
void ArrayUtils::copyArrayToStorage(ArrayType const& _targetType, ArrayType const& _sourceType) const
diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h
index 4028ae63..48d9e9d6 100644
--- a/libsolidity/codegen/Compiler.h
+++ b/libsolidity/codegen/Compiler.h
@@ -23,7 +23,7 @@
#pragma once
#include <libsolidity/codegen/CompilerContext.h>
-#include <libsolidity/interface/EVMVersion.h>
+#include <liblangutil/EVMVersion.h>
#include <libevmasm/Assembly.h>
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp
index 6e14d68a..9e4f2882 100644
--- a/libsolidity/codegen/CompilerContext.cpp
+++ b/libsolidity/codegen/CompilerContext.cpp
@@ -25,9 +25,10 @@
#include <libsolidity/ast/AST.h>
#include <libsolidity/codegen/Compiler.h>
#include <libsolidity/interface/Version.h>
-#include <libsolidity/interface/ErrorReporter.h>
+#include <liblangutil/ErrorReporter.h>
+#include <liblangutil/Scanner.h>
#include <libsolidity/interface/SourceReferenceFormatter.h>
-#include <libsolidity/parsing/Scanner.h>
+#include <liblangutil/Scanner.h>
#include <libsolidity/inlineasm/AsmParser.h>
#include <libsolidity/inlineasm/AsmCodeGen.h>
#include <libsolidity/inlineasm/AsmAnalysis.h>
@@ -47,6 +48,7 @@
using namespace std;
+using namespace langutil;
namespace dev
{
@@ -359,7 +361,7 @@ void CompilerContext::appendInlineAssembly(
ErrorList errors;
ErrorReporter errorReporter(errors);
- auto scanner = make_shared<Scanner>(CharStream(_assembly), "--CODEGEN--");
+ auto scanner = make_shared<langutil::Scanner>(langutil::CharStream(_assembly), "--CODEGEN--");
auto parserResult = assembly::Parser(errorReporter, assembly::AsmFlavour::Strict).parse(scanner, false);
#ifdef SOL_OUTPUT_ASM
cout << assembly::AsmPrinter()(*parserResult) << endl;
diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h
index 5bdc1d19..63365175 100644
--- a/libsolidity/codegen/CompilerContext.h
+++ b/libsolidity/codegen/CompilerContext.h
@@ -24,7 +24,7 @@
#include <libsolidity/codegen/ABIFunctions.h>
-#include <libsolidity/interface/EVMVersion.h>
+#include <liblangutil/EVMVersion.h>
#include <libsolidity/ast/ASTForward.h>
#include <libsolidity/ast/Types.h>
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index a0d11017..93c8cc77 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -32,6 +32,7 @@
#include <libdevcore/Whiskers.h>
using namespace std;
+using namespace langutil;
namespace dev
{
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp
index 1fdf3483..7a1dcd70 100644
--- a/libsolidity/codegen/ContractCompiler.cpp
+++ b/libsolidity/codegen/ContractCompiler.cpp
@@ -23,7 +23,7 @@
#include <libsolidity/codegen/ContractCompiler.h>
#include <libsolidity/inlineasm/AsmCodeGen.h>
#include <libsolidity/ast/AST.h>
-#include <libsolidity/interface/ErrorReporter.h>
+#include <liblangutil/ErrorReporter.h>
#include <libsolidity/codegen/ExpressionCompiler.h>
#include <libsolidity/codegen/CompilerUtils.h>
@@ -37,6 +37,7 @@
using namespace std;
using namespace dev;
+using namespace langutil;
using namespace dev::solidity;
namespace
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index bdf91fbf..57b513d2 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -36,6 +36,7 @@
#include <libdevcore/Whiskers.h>
using namespace std;
+using namespace langutil;
namespace dev
{
diff --git a/libsolidity/codegen/ExpressionCompiler.h b/libsolidity/codegen/ExpressionCompiler.h
index 9a695b4c..2bfaab43 100644
--- a/libsolidity/codegen/ExpressionCompiler.h
+++ b/libsolidity/codegen/ExpressionCompiler.h
@@ -25,10 +25,10 @@
#include <memory>
#include <boost/noncopyable.hpp>
#include <libdevcore/Common.h>
-#include <libevmasm/SourceLocation.h>
+#include <liblangutil/SourceLocation.h>
#include <libsolidity/ast/ASTVisitor.h>
#include <libsolidity/codegen/LValue.h>
-#include <libsolidity/interface/Exceptions.h>
+#include <liblangutil/Exceptions.h>
namespace dev {
namespace eth
diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp
index 790ab309..6d71d36f 100644
--- a/libsolidity/codegen/LValue.cpp
+++ b/libsolidity/codegen/LValue.cpp
@@ -28,6 +28,7 @@
using namespace std;
using namespace dev;
+using namespace langutil;
using namespace solidity;
diff --git a/libsolidity/codegen/LValue.h b/libsolidity/codegen/LValue.h
index 6054af28..d854857b 100644
--- a/libsolidity/codegen/LValue.h
+++ b/libsolidity/codegen/LValue.h
@@ -24,7 +24,7 @@
#include <memory>
#include <vector>
-#include <libevmasm/SourceLocation.h>
+#include <liblangutil/SourceLocation.h>
#include <libsolidity/codegen/ArrayUtils.h>
namespace dev
@@ -55,17 +55,17 @@ public:
/// Copies the value of the current lvalue to the top of the stack and, if @a _remove is true,
/// also removes the reference from the stack.
/// @a _location source location of the current expression, used for error reporting.
- virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const = 0;
+ virtual void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const = 0;
/// Moves a value from the stack to the lvalue. Removes the value if @a _move is true.
/// @a _location is the source location of the expression that caused this operation.
/// Stack pre: value [lvalue_ref]
/// Stack post: if !_move: value_of(lvalue_ref)
virtual void storeValue(Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(), bool _move = false) const = 0;
+ langutil::SourceLocation const& _location = {}, bool _move = false) const = 0;
/// Stores zero in the lvalue. Removes the reference from the stack if @a _removeReference is true.
/// @a _location is the source location of the requested operation
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const = 0;
@@ -83,14 +83,14 @@ public:
StackVariable(CompilerContext& _compilerContext, VariableDeclaration const& _declaration);
unsigned sizeOnStack() const override { return 0; }
- void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
+ void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue(
Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _move = false
) const override;
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const override;
@@ -109,14 +109,14 @@ class MemoryItem: public LValue
public:
MemoryItem(CompilerContext& _compilerContext, Type const& _type, bool _padded = true);
unsigned sizeOnStack() const override { return 1; }
- void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
+ void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue(
Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _move = false
) const override;
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const override;
private:
@@ -137,14 +137,14 @@ public:
/// Constructs the LValue and assumes that the storage reference is already on the stack.
StorageItem(CompilerContext& _compilerContext, Type const& _type);
unsigned sizeOnStack() const override { return 2; }
- void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
+ void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue(
Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _move = false
) const override;
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const override;
};
@@ -159,14 +159,14 @@ public:
/// Constructs the LValue and assumes that the storage reference is already on the stack.
StorageByteArrayElement(CompilerContext& _compilerContext);
unsigned sizeOnStack() const override { return 2; }
- void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
+ void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue(
Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _move = false
) const override;
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const override;
};
@@ -181,14 +181,14 @@ class StorageArrayLength: public LValue
public:
/// Constructs the LValue, assumes that the reference to the array head is already on the stack.
StorageArrayLength(CompilerContext& _compilerContext, ArrayType const& _arrayType);
- void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
+ void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue(
Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _move = false
) const override;
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const override;
@@ -206,14 +206,14 @@ public:
/// Empty unique_ptrs are possible if e.g. some values should be ignored during assignment.
TupleObject(CompilerContext& _compilerContext, std::vector<std::unique_ptr<LValue>>&& _lvalues);
unsigned sizeOnStack() const override;
- void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
+ void retrieveValue(langutil::SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue(
Type const& _sourceType,
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _move = false
) const override;
virtual void setToZero(
- SourceLocation const& _location = SourceLocation(),
+ langutil::SourceLocation const& _location = {},
bool _removeReference = true
) const override;