Skip to content

Rename wasm-delegations[-fields].h to def files (NFC) #3941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ if(NOT (BUILD_STATIC_LIB AND BYN_INSTALL_TOOLS_ONLY))
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT BYN_INSTALL_TOOLS_ONLY)
install(FILES src/binaryen-c.h src/wasm-delegations.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES src/binaryen-c.h src/wasm-delegations.def DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()

function(binaryen_add_executable name sources)
Expand Down
2 changes: 1 addition & 1 deletion src/binaryen-c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ BinaryenExpressionId BinaryenInvalidId(void) {
return Expression::Id::CLASS_TO_VISIT##Id; \
}

#include "wasm-delegations.h"
#include "wasm-delegations.def"

// External kinds

Expand Down
2 changes: 1 addition & 1 deletion src/binaryen-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ BINARYEN_API BinaryenExpressionId BinaryenInvalidId(void);
#define DELEGATE(CLASS_TO_VISIT) \
BINARYEN_API BinaryenExpressionId Binaryen##CLASS_TO_VISIT##Id(void);

#include "wasm-delegations.h"
#include "wasm-delegations.def"

// External kinds (call to get the value of each; you can cache them)

Expand Down
4 changes: 2 additions & 2 deletions src/ir/ExpressionAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ bool ExpressionAnalyzer::flexibleEqual(Expression* left,
} \
}

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"

return true;
}
Expand Down Expand Up @@ -322,7 +322,7 @@ size_t ExpressionAnalyzer::hash(Expression* curr) {

#define DELEGATE_FIELD_SCOPE_NAME_USE(id, name) visitScopeName(cast->name);

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"
}

void noteScopeName(Name curr) {
Expand Down
2 changes: 1 addition & 1 deletion src/ir/ExpressionManipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {

#define DELEGATE_FIELD_INT_ARRAY(id, name) COPY_ARRAY(name)

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"

// The type can be simply copied.
copy->type = original->type;
Expand Down
4 changes: 2 additions & 2 deletions src/ir/branch-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ template<typename T> void operateOnScopeNameUses(Expression* expr, T func) {
#define DELEGATE_FIELD_CHILD_VECTOR(id, name)
#define DELEGATE_FIELD_INT_ARRAY(id, name)

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"
}

// Similar to operateOnScopeNameUses, but also passes in the type that is sent
Expand Down Expand Up @@ -131,7 +131,7 @@ template<typename T> void operateOnScopeNameDefs(Expression* expr, T func) {
#define DELEGATE_FIELD_SCOPE_NAME_USE(id, name)
#define DELEGATE_FIELD_SCOPE_NAME_USE_VECTOR(id, name)

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"
}

using NameSet = std::set<Name>;
Expand Down
2 changes: 1 addition & 1 deletion src/ir/iteration.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ template<class Specific> class AbstractChildIterator {
#define DELEGATE_FIELD_TYPE(id, name)
#define DELEGATE_FIELD_ADDRESS(id, name)

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"
}

Iterator begin() const { return Iterator(*this, 0); }
Expand Down
4 changes: 2 additions & 2 deletions src/ir/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct ReFinalize
#define DELEGATE(CLASS_TO_VISIT) \
void visit##CLASS_TO_VISIT(CLASS_TO_VISIT* curr);

#include "wasm-delegations.h"
#include "wasm-delegations.def"

void visitFunction(Function* curr);

Expand All @@ -139,7 +139,7 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> {
#define DELEGATE(CLASS_TO_VISIT) \
void visit##CLASS_TO_VISIT(CLASS_TO_VISIT* curr) { curr->finalize(); }

#include "wasm-delegations.h"
#include "wasm-delegations.def"

void visitExport(Export* curr) { WASM_UNREACHABLE("unimp"); }
void visitGlobal(Global* curr) { WASM_UNREACHABLE("unimp"); }
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/wasm-stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class BinaryInstWriter : public OverriddenVisitor<BinaryInstWriter> {
#define DELEGATE(CLASS_TO_VISIT) \
void visit##CLASS_TO_VISIT(CLASS_TO_VISIT* curr);

#include "wasm-delegations.h"
#include "wasm-delegations.def"

void emitResultType(Type type);
void emitIfElse(If* curr);
Expand Down
14 changes: 7 additions & 7 deletions src/wasm-traversal.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ template<typename SubType, typename ReturnType = void> struct Visitor {
ReturnType visit##CLASS_TO_VISIT(CLASS_TO_VISIT* curr) { \
return ReturnType(); \
}
#include "wasm-delegations.h"
#include "wasm-delegations.def"

// Module-level visitors
ReturnType visitExport(Export* curr) { return ReturnType(); }
Expand All @@ -62,7 +62,7 @@ template<typename SubType, typename ReturnType = void> struct Visitor {
return static_cast<SubType*>(this)->visit##CLASS_TO_VISIT( \
static_cast<CLASS_TO_VISIT*>(curr))

#include "wasm-delegations.h"
#include "wasm-delegations.def"

default:
WASM_UNREACHABLE("unexpected expression type");
Expand All @@ -84,7 +84,7 @@ struct OverriddenVisitor {
WASM_UNREACHABLE("Derived class must implement visit" #CLASS_TO_VISIT); \
}

#include "wasm-delegations.h"
#include "wasm-delegations.def"

ReturnType visit(Expression* curr) {
assert(curr);
Expand All @@ -95,7 +95,7 @@ struct OverriddenVisitor {
return static_cast<SubType*>(this)->visit##CLASS_TO_VISIT( \
static_cast<CLASS_TO_VISIT*>(curr))

#include "wasm-delegations.h"
#include "wasm-delegations.def"

default:
WASM_UNREACHABLE("unexpected expression type");
Expand All @@ -117,7 +117,7 @@ struct UnifiedExpressionVisitor : public Visitor<SubType, ReturnType> {
return static_cast<SubType*>(this)->visitExpression(curr); \
}

#include "wasm-delegations.h"
#include "wasm-delegations.def"
};

//
Expand Down Expand Up @@ -327,7 +327,7 @@ struct Walker : public VisitorType {
self->visit##CLASS_TO_VISIT((*currp)->cast<CLASS_TO_VISIT>()); \
}

#include "wasm-delegations.h"
#include "wasm-delegations.def"

void setModule(Module* module) { currModule = module; }

Expand Down Expand Up @@ -377,7 +377,7 @@ struct PostWalker : public Walker<SubType, VisitorType> {
#define DELEGATE_FIELD_TYPE(id, name)
#define DELEGATE_FIELD_ADDRESS(id, name)

#include "wasm-delegations-fields.h"
#include "wasm-delegations-fields.def"
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/wasm/wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const char* getExpressionName(Expression* curr) {
case Expression::Id::CLASS_TO_VISIT##Id: \
return #CLASS_TO_VISIT;

#include "wasm-delegations.h"
#include "wasm-delegations.def"

default:
WASM_UNREACHABLE("invalid id");
Expand Down