Skip to content

Commit

Permalink
Rename AsmData -> AST
Browse files Browse the repository at this point in the history
Also attempt to only include ASTForward where appropriate.
  • Loading branch information
axic committed Nov 25, 2020
1 parent 7eb5fc3 commit a22077f
Show file tree
Hide file tree
Showing 157 changed files with 175 additions and 152 deletions.
2 changes: 1 addition & 1 deletion libsolidity/analysis/ControlFlowBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// SPDX-License-Identifier: GPL-3.0

#include <libsolidity/analysis/ControlFlowBuilder.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/EVMDialect.h>

using namespace solidity;
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/analysis/ReferencesResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <libyul/AsmAnalysis.h>
#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/EVMDialect.h>

#include <liblangutil/ErrorReporter.h>
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/analysis/SyntaxChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <libsolidity/interface/Version.h>

#include <libyul/optimiser/Semantics.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>

#include <liblangutil/ErrorReporter.h>
#include <liblangutil/SemVerHandler.h>
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/analysis/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <libyul/AsmAnalysis.h>
#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>

#include <liblangutil/ErrorReporter.h>

Expand Down
2 changes: 1 addition & 1 deletion libsolidity/analysis/ViewPureChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <libsolidity/analysis/ViewPureChecker.h>
#include <libsolidity/ast/ExperimentalFeatures.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/EVMDialect.h>
#include <liblangutil/ErrorReporter.h>
#include <libevmasm/SemanticInformation.h>
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/ast/AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

namespace solidity::yul
{
// Forward-declaration to <yul/AsmData.h>
// Forward-declaration to <yul/AST.h>
struct Block;
struct Dialect;
}
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/ast/ASTJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <libsolidity/ast/TypeProvider.h>

#include <libyul/AsmJsonConverter.h>
#include <libyul/AsmData.h>
#include <libyul/AsmPrinter.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/EVMDialect.h>

#include <libsolutil/JSON.h>
Expand Down
1 change: 1 addition & 0 deletions libsolidity/ast/ASTJsonImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <libyul/AsmJsonImporter.h>
#include <libyul/AsmParser.h>
#include <libyul/AST.h>
#include <libyul/Dialect.h>
#include <libyul/backends/evm/EVMDialect.h>

Expand Down
1 change: 1 addition & 0 deletions libsolidity/codegen/CompilerContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <libyul/AsmPrinter.h>
#include <libyul/AsmAnalysis.h>
#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/AsmCodeGen.h>
#include <libyul/backends/evm/EVMDialect.h>
#include <libyul/backends/evm/EVMMetrics.h>
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/codegen/ContractCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AsmAnalysis.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/AsmCodeGen.h>
#include <libyul/backends/evm/EVMMetrics.h>
#include <libyul/backends/evm/EVMDialect.h>
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/codegen/ir/IRGeneratorForStatements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <libevmasm/GasMeter.h>

#include <libyul/AsmPrinter.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Dialect.h>
#include <libyul/optimiser/ASTCopier.h>

Expand Down
1 change: 1 addition & 0 deletions libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <libyul/AsmJsonConverter.h>
#include <libyul/AssemblyStack.h>
#include <libyul/AsmParser.h>
#include <libyul/AST.h>

#include <liblangutil/Scanner.h>
#include <liblangutil/SemVerHandler.h>
Expand Down
1 change: 1 addition & 0 deletions libsolidity/parsing/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <libsolidity/interface/Version.h>
#include <libyul/AsmParser.h>
#include <libyul/AST.h>
#include <libyul/backends/evm/EVMDialect.h>
#include <liblangutil/ErrorReporter.h>
#include <liblangutil/Scanner.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmData.h → libyul/AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>
#include <libyul/YulString.h>

#include <liblangutil/SourceLocation.h>
Expand Down
1 change: 1 addition & 0 deletions libyul/AsmDataForward.h → libyul/ASTForward.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
namespace solidity::yul
{

enum class LiteralKind;
struct Literal;
struct Label;
struct Identifier;
Expand Down
7 changes: 6 additions & 1 deletion libyul/AsmAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <libyul/AsmAnalysis.h>

#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/AsmScopeFiller.h>
#include <libyul/AsmScope.h>
#include <libyul/AsmAnalysisInfo.h>
Expand Down Expand Up @@ -668,3 +668,8 @@ bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocatio

return true;
}

bool AsmAnalyzer::validateInstructions(FunctionCall const& _functionCall)
{
return validateInstructions(_functionCall.functionName.name.str(), _functionCall.functionName.location);
}
7 changes: 2 additions & 5 deletions libyul/AsmAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <libyul/Dialect.h>
#include <libyul/AsmScope.h>
#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>

#include <libyul/backends/evm/AbstractAssembly.h>
#include <libyul/backends/evm/EVMDialect.h>
Expand Down Expand Up @@ -114,10 +114,7 @@ class AsmAnalyzer

bool validateInstructions(evmasm::Instruction _instr, langutil::SourceLocation const& _location);
bool validateInstructions(std::string const& _instrIdentifier, langutil::SourceLocation const& _location);
bool validateInstructions(FunctionCall const& _functionCall)
{
return validateInstructions(_functionCall.functionName.name.str(), _functionCall.functionName.location);
}
bool validateInstructions(FunctionCall const& _functionCall);

yul::ExternalIdentifierAccess::Resolver m_resolver;
Scope* m_currentScope = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmAnalysisInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#pragma once

#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>

#include <map>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

#include <libyul/AsmJsonConverter.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Exceptions.h>
#include <libsolutil/CommonData.h>

Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmJsonConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>
#include <liblangutil/SourceLocation.h>
#include <json/json.h>
#include <boost/variant.hpp>
Expand Down
3 changes: 1 addition & 2 deletions libyul/AsmJsonImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*/

#include <libyul/AsmJsonImporter.h>
#include <libyul/AsmData.h>
#include <libyul/AsmDataForward.h>
#include <libyul/AST.h>
#include <libyul/Exceptions.h>

#include <liblangutil/Scanner.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmJsonImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <json/json.h>
#include <liblangutil/SourceLocation.h>
#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>

#include <utility>

Expand Down
1 change: 1 addition & 0 deletions libyul/AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include <libyul/AsmParser.h>
#include <libyul/AST.h>
#include <libyul/Exceptions.h>
#include <liblangutil/Scanner.h>
#include <liblangutil/ErrorReporter.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#include <libyul/AsmData.h>
#include <libyul/ASTForward.h>
#include <libyul/Dialect.h>

#include <liblangutil/SourceLocation.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

#include <libyul/AsmPrinter.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Exceptions.h>
#include <libyul/Dialect.h>

Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>

#include <libyul/YulString.h>

Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmScopeFiller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <libyul/AsmScopeFiller.h>

#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/AsmScope.h>
#include <libyul/AsmAnalysisInfo.h>
#include <libyul/Exceptions.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmScopeFiller.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#pragma once

#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>

#include <functional>
#include <memory>
Expand Down
4 changes: 2 additions & 2 deletions libyul/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ add_library(yul
AsmAnalysis.cpp
AsmAnalysis.h
AsmAnalysisInfo.h
AsmData.h
AsmDataForward.h
AST.h
ASTForward.h
AsmJsonConverter.h
AsmJsonConverter.cpp
AsmJsonImporter.h
Expand Down
2 changes: 1 addition & 1 deletion libyul/CompilabilityChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma once

#include <libyul/Dialect.h>
#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>
#include <libyul/Object.h>

#include <map>
Expand Down
2 changes: 1 addition & 1 deletion libyul/Dialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include <libyul/Dialect.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>

using namespace solidity::yul;
using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion libyul/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#pragma once

#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>
#include <libyul/YulString.h>

#include <libsolutil/Common.h>
Expand Down
1 change: 1 addition & 0 deletions libyul/ObjectParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <libyul/ObjectParser.h>

#include <libyul/AsmParser.h>
#include <libyul/AST.h>
#include <libyul/Exceptions.h>

#include <liblangutil/Token.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <libyul/Utilities.h>

#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Exceptions.h>

#include <libsolutil/CommonData.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma once

#include <libsolutil/Common.h>
#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>

namespace solidity::yul
{
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/AsmCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include <libyul/backends/evm/AsmCodeGen.h>

#include <libyul/AsmData.h>
#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AST.h>

#include <libyul/backends/evm/AbstractAssembly.h>
#include <libyul/backends/evm/EVMCodeTransform.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/ConstantOptimiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <libyul/optimiser/ASTCopier.h>
#include <libyul/backends/evm/EVMMetrics.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Utilities.h>

#include <libsolutil/CommonData.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/ConstantOptimiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <libyul/YulString.h>
#include <libyul/Dialect.h>
#include <libyul/backends/evm/EVMDialect.h>
#include <libyul/AsmData.h>
#include <libyul/ASTForward.h>

#include <liblangutil/SourceLocation.h>

Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/EVMCodeTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <libyul/optimiser/NameCollector.h>
#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Utilities.h>

#include <liblangutil/Exceptions.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/EVMCodeTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <libyul/backends/evm/EVMDialect.h>
#include <libyul/optimiser/ASTWalker.h>
#include <libyul/AsmDataForward.h>
#include <libyul/ASTForward.h>
#include <libyul/AsmScope.h>

#include <optional>
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/EVMDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <libyul/backends/evm/EVMDialect.h>

#include <libyul/AsmAnalysisInfo.h>
#include <libyul/AsmData.h>
#include <libyul/AST.h>
#include <libyul/Object.h>
#include <libyul/Exceptions.h>
#include <libyul/AsmParser.h>
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/EVMDialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <libyul/Dialect.h>

#include <libyul/backends/evm/AbstractAssembly.h>
#include <libyul/AsmData.h>
#include <libyul/ASTForward.h>
#include <liblangutil/EVMVersion.h>

#include <map>
Expand Down
Loading

0 comments on commit a22077f

Please sign in to comment.