diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-12-03 14:58:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 14:58:39 -0800 |
commit | d6444b5032a64f3abe35bf60eb96e151669d2fa5 (patch) | |
tree | 3df9f4aa3819961e63c9f1da640ec607abe2fbca /src/wasm-type.h | |
parent | 15356635e34ed8981c993d67ed90e83bc7bfa405 (diff) | |
download | binaryen-d6444b5032a64f3abe35bf60eb96e151669d2fa5.tar.gz binaryen-d6444b5032a64f3abe35bf60eb96e151669d2fa5.tar.bz2 binaryen-d6444b5032a64f3abe35bf60eb96e151669d2fa5.zip |
[NFC] Rename BasicID to BasicType (#3419)
This name is more descriptive and paves the way toward interning HeapTypes as
well, with an analogous BasicHeapType.
Diffstat (limited to 'src/wasm-type.h')
-rw-r--r-- | src/wasm-type.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/wasm-type.h b/src/wasm-type.h index 9019dfc9e..77f7120bf 100644 --- a/src/wasm-type.h +++ b/src/wasm-type.h @@ -33,13 +33,13 @@ namespace wasm { class Type { // The `id` uniquely represents each type, so type equality is just a - // comparison of the ids. For basic types the `id` is just the `BasicID` + // comparison of the ids. For basic types the `id` is just the `BasicType` // enum value below, and for constructed types the `id` is the address of the // canonical representation of the type, making lookups cheap for all types. uintptr_t id; public: - enum BasicID : uint32_t { + enum BasicType : uint32_t { none, unreachable, i32, @@ -58,8 +58,8 @@ public: Type() = default; - // BasicID can be implicitly upgraded to Type - constexpr Type(BasicID id) : id(id){}; + // BasicType can be implicitly upgraded to Type + constexpr Type(BasicType id) : id(id){}; // But converting raw uint32_t is more dangerous, so make it explicit explicit Type(uint64_t id) : id(id){}; @@ -131,18 +131,18 @@ public: bool hasRef() { return hasPredicate<&Type::isRef>(); } constexpr uint64_t getID() const { return id; } - constexpr BasicID getBasic() const { + constexpr BasicType getBasic() const { assert(isBasic() && "Basic type expected"); - return static_cast<BasicID>(id); + return static_cast<BasicType>(id); } - // (In)equality must be defined for both Type and BasicID because it is + // (In)equality must be defined for both Type and BasicType because it is // otherwise ambiguous whether to convert both this and other to int or // convert other to Type. bool operator==(const Type& other) const { return id == other.id; } - bool operator==(const BasicID& otherId) const { return id == otherId; } + bool operator==(const BasicType& otherId) const { return id == otherId; } bool operator!=(const Type& other) const { return id != other.id; } - bool operator!=(const BasicID& otherId) const { return id != otherId; } + bool operator!=(const BasicType& otherId) const { return id != otherId; } // Order types by some notion of simplicity bool operator<(const Type& other) const; |