Skip to content
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

Rename .def files to .inc files #20

Merged
merged 1 commit into from
Nov 2, 2020
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
6 changes: 3 additions & 3 deletions include/wasp/base/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Features {
// Names look like: Features::BulkMemoryIndex
enum {
#define WASP_V(enum_, variable, flag, default_) enum_##Index,
#include "wasp/base/features.def"
#include "wasp/base/features.inc"
#undef WASP_V
};

Expand All @@ -39,7 +39,7 @@ class Features {
enum {
#define WASP_V(enum_, variable, flag, default_) \
enum_ = u64{1} << int(enum_##Index),
#include "wasp/base/features.def"
#include "wasp/base/features.inc"
#undef WASP_V
};

Expand All @@ -66,7 +66,7 @@ class Features {
} \
UpdateDependencies(); \
}
#include "wasp/base/features.def"
#include "wasp/base/features.inc"
#undef WASP_V

friend bool operator==(const Features& lhs, const Features& rhs);
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions include/wasp/base/wasm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum class Opcode : u32 {
#define WASP_V(prefix, val, Name, str, ...) Name,
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#define WASP_PREFIX_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/opcode.def"
#include "wasp/base/inc/opcode.inc"
#undef WASP_V
#undef WASP_FEATURE_V
#undef WASP_PREFIX_V
Expand All @@ -40,52 +40,52 @@ enum class Opcode : u32 {
enum class PackedType : u8 {
#define WASP_V(val, Name, str) Name = val,
#define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str)
#include "wasp/base/def/packed_type.def"
#include "wasp/base/inc/packed_type.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};

enum class NumericType : u8 {
#define WASP_V(val, Name, str) Name = val,
#define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str)
#include "wasp/base/def/numeric_type.def"
#include "wasp/base/inc/numeric_type.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};

enum class ReferenceKind : u8 {
#define WASP_V(val, Name, str) Name = val,
#define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str)
#include "wasp/base/def/reference_kind.def"
#include "wasp/base/inc/reference_kind.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};

enum class HeapKind : u8 {
#define WASP_V(val, Name, str) Name = val,
#define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str)
#include "wasp/base/def/heap_kind.def"
#include "wasp/base/inc/heap_kind.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};

enum class ExternalKind : u8 {
#define WASP_V(val, Name, str) Name = val,
#define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str)
#include "wasp/base/def/external_kind.def"
#include "wasp/base/inc/external_kind.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};

enum class EventAttribute : u8 {
#define WASP_V(val, Name, str) Name = val,
#include "wasp/base/def/event_attribute.def"
#include "wasp/base/inc/event_attribute.inc"
#undef WASP_V
};

enum class Mutability : u8 {
#define WASP_V(val, Name, str) Name = val,
#include "wasp/base/def/mutability.def"
#include "wasp/base/inc/mutability.inc"
#undef WASP_V
};

Expand Down
8 changes: 4 additions & 4 deletions include/wasp/binary/linking_section/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ namespace wasp::binary {

enum class ComdatSymbolKind : u8 {
#define WASP_V(val, Name, str) Name = val,
#include "wasp/binary/def/comdat_symbol_kind.def"
#include "wasp/binary/inc/comdat_symbol_kind.inc"
#undef WASP_V
};

enum class LinkingSubsectionId : u8 {
#define WASP_V(val, Name, str) Name = val,
#include "wasp/binary/def/linking_subsection_id.def"
#include "wasp/binary/inc/linking_subsection_id.inc"
#undef WASP_V
};

enum class RelocationType : u8 {
#define WASP_V(val, Name, str) Name = val,
#define WASP_FEATURE_V(val, Name, str, feature) WASP_V(val, Name, str)
#include "wasp/binary/def/relocation_type.def"
#include "wasp/binary/inc/relocation_type.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};

enum class SymbolInfoKind : u8 {
#define WASP_V(val, Name, str) Name = val,
#include "wasp/binary/def/symbol_info_kind.def"
#include "wasp/binary/inc/symbol_info_kind.inc"
#undef WASP_V
};

Expand Down
2 changes: 1 addition & 1 deletion include/wasp/binary/name_section/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace wasp::binary {

enum class NameSubsectionId : u8 {
#define WASP_V(val, Name, str) Name = val,
#include "wasp/binary/def/name_subsection_id.def"
#include "wasp/binary/inc/name_subsection_id.inc"
#undef WASP_V
};

Expand Down
2 changes: 1 addition & 1 deletion include/wasp/binary/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct StorageType {
enum class SectionId : u32 {
#define WASP_V(val, Name, str, ...) Name,
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#include "wasp/binary/def/section_id.def"
#include "wasp/binary/inc/section_id.inc"
#undef WASP_V
#undef WASP_FEATURE_V
};
Expand Down
2 changes: 1 addition & 1 deletion include/wasp/text/read/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace wasp::text {

enum class TokenType {
#define WASP_V(Name) Name,
#include "wasp/text/token_type.def"
#include "wasp/text/token_type.inc"
#undef WASP_V
};

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
// limitations under the License.
//

#include "wasp/base/def/value_type.def"
#include "wasp/base/inc/value_type.inc"
WASP_V(-1, Any, "any")
19 changes: 14 additions & 5 deletions src/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,38 @@ add_library(libwasp_base
../../include/wasp/base/bitcast.h
../../include/wasp/base/buffer.h
../../include/wasp/base/concat.h
../../include/wasp/base/enumerate-inl.h
../../include/wasp/base/enumerate.h
../../include/wasp/base/enumerate-inl.h
../../include/wasp/base/error.h
../../include/wasp/base/errors-inl.h
../../include/wasp/base/errors.h
../../include/wasp/base/errors_context_guard.h
../../include/wasp/base/errors.h
../../include/wasp/base/errors-inl.h
../../include/wasp/base/errors_nop.h
../../include/wasp/base/features.h
../../include/wasp/base/features.inc
../../include/wasp/base/file.h
../../include/wasp/base/formatter_macros.h
../../include/wasp/base/formatters.h
../../include/wasp/base/hash.h
../../include/wasp/base/hashmap.h
../../include/wasp/base/inc/event_attribute.inc
../../include/wasp/base/inc/external_kind.inc
../../include/wasp/base/inc/heap_kind.inc
../../include/wasp/base/inc/mutability.inc
../../include/wasp/base/inc/numeric_type.inc
../../include/wasp/base/inc/opcode.inc
../../include/wasp/base/inc/packed_type.inc
../../include/wasp/base/inc/reference_kind.inc
../../include/wasp/base/macros.h
../../include/wasp/base/operator_eq_ne_macros.h
../../include/wasp/base/optional.h
../../include/wasp/base/span.h
../../include/wasp/base/str_to_u32.h
../../include/wasp/base/string_view.h
../../include/wasp/base/str_to_u32.h
../../include/wasp/base/types.h
../../include/wasp/base/utf8.h
../../include/wasp/base/v128-inl.h
../../include/wasp/base/v128.h
../../include/wasp/base/v128-inl.h
../../include/wasp/base/variant.h
../../include/wasp/base/wasm_types.h

Expand Down
4 changes: 2 additions & 2 deletions src/base/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace wasp {
Features::Features() {
#define WASP_V(enum_, variable, flag, default_) \
set_##variable##_enabled(default_);
#include "wasp/base/features.def"
#include "wasp/base/features.inc"
#undef WASP_V
}

Expand All @@ -33,7 +33,7 @@ Features::Features(Bits bits) : bits_{bits} {

void Features::EnableAll() {
#define WASP_V(enum_, variable, flag, default_) enable_##variable();
#include "wasp/base/features.def"
#include "wasp/base/features.inc"
#undef WASP_V
}

Expand Down
18 changes: 9 additions & 9 deletions src/base/formatters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::Opcode& self) {
break;
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#define WASP_PREFIX_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/opcode.def"
#include "wasp/base/inc/opcode.inc"
#undef WASP_V
#undef WASP_FEATURE_V
#undef WASP_PREFIX_V
Expand All @@ -76,7 +76,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::PackedType& self) {
result = str; \
break;
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/packed_type.def"
#include "wasp/base/inc/packed_type.inc"
#undef WASP_V
#undef WASP_FEATURE_V
default:
Expand All @@ -93,7 +93,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::NumericType& self) {
result = str; \
break;
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/numeric_type.def"
#include "wasp/base/inc/numeric_type.inc"
#undef WASP_V
#undef WASP_FEATURE_V
default:
Expand All @@ -110,7 +110,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::ReferenceKind& self) {
result = str; \
break;
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/reference_kind.def"
#include "wasp/base/inc/reference_kind.inc"
#undef WASP_V
#undef WASP_FEATURE_V
default:
Expand All @@ -127,7 +127,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::HeapKind& self) {
result = str; \
break;
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/heap_kind.def"
#include "wasp/base/inc/heap_kind.inc"
#undef WASP_V
#undef WASP_FEATURE_V
default:
Expand All @@ -144,7 +144,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::ExternalKind& self) {
result = str; \
break;
#define WASP_FEATURE_V(...) WASP_V(__VA_ARGS__)
#include "wasp/base/def/external_kind.def"
#include "wasp/base/inc/external_kind.inc"
#undef WASP_V
#undef WASP_FEATURE_V
default:
Expand All @@ -160,7 +160,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::EventAttribute& self) {
case ::wasp::EventAttribute::Name: \
result = str; \
break;
#include "wasp/base/def/event_attribute.def"
#include "wasp/base/inc/event_attribute.inc"
#undef WASP_V
default:
WASP_UNREACHABLE();
Expand All @@ -175,7 +175,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::Mutability& self) {
case ::wasp::Mutability::Name: \
result = str; \
break;
#include "wasp/base/def/mutability.def"
#include "wasp/base/inc/mutability.inc"
#undef WASP_V
default:
WASP_UNREACHABLE();
Expand Down Expand Up @@ -208,7 +208,7 @@ std::ostream& operator<<(std::ostream& os, const ::wasp::Features& self) {
os << #variable << separator; \
separator = "|"; \
}
#include "wasp/base/features.def"
#include "wasp/base/features.inc"
#undef WASP_V

if (separator.size() == 0) {
Expand Down
22 changes: 14 additions & 8 deletions src/binary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
add_library(libwasp_binary
../../include/wasp/binary/encoding.h
../../include/wasp/binary/formatters.h
../../include/wasp/binary/inc/comdat_symbol_kind.inc
../../include/wasp/binary/inc/linking_subsection_id.inc
../../include/wasp/binary/inc/name_subsection_id.inc
../../include/wasp/binary/inc/relocation_type.inc
../../include/wasp/binary/inc/section_id.inc
../../include/wasp/binary/inc/symbol_info_kind.inc
../../include/wasp/binary/lazy_expression.h
../../include/wasp/binary/lazy_module.h
../../include/wasp/binary/lazy_module_utils-inl.h
../../include/wasp/binary/lazy_module_utils.h
../../include/wasp/binary/lazy_module_utils-inl.h
../../include/wasp/binary/lazy_section.h
../../include/wasp/binary/lazy_sequence-inl.h
../../include/wasp/binary/lazy_sequence.h
../../include/wasp/binary/read.h
../../include/wasp/binary/sections.h
../../include/wasp/binary/types.h
../../include/wasp/binary/var_int.h
../../include/wasp/binary/visitor.h
../../include/wasp/binary/write.h
../../include/wasp/binary/lazy_sequence-inl.h
../../include/wasp/binary/linking_section/encoding.h
../../include/wasp/binary/linking_section/formatters.h
../../include/wasp/binary/linking_section/read.h
Expand All @@ -43,10 +43,16 @@ add_library(libwasp_binary
../../include/wasp/binary/name_section/types.h
../../include/wasp/binary/name_section/write.h
../../include/wasp/binary/read/context.h
../../include/wasp/binary/read.h
../../include/wasp/binary/read/location_guard.h
../../include/wasp/binary/read/macros.h
../../include/wasp/binary/read/read_var_int.h
../../include/wasp/binary/read/read_vector.h
../../include/wasp/binary/sections.h
../../include/wasp/binary/types.h
../../include/wasp/binary/var_int.h
../../include/wasp/binary/visitor.h
../../include/wasp/binary/write.h

context.cc
encoding.cc
Expand Down
Loading