-
Notifications
You must be signed in to change notification settings - Fork 758
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
Move Type-related functions into Type class (NFC) #2556
Conversation
a39dcda
to
2be26a2
Compare
Several type-related functions currently exist outside of `Type` class and thus in the `wasm`, effectively global, namespace. This moves these functions into `Type` class, making them either member functions or static functions. Also this renames `getSize` to `getByteSize` to make it not to be confused with `size`, which returns the number of types in multiple types. This also reorders the order of functions in `wasm-type.cpp` to match that of `wasm-type.h`.
2be26a2
to
944ae89
Compare
src/wasm-type.h
Outdated
|
||
// Reinterpret an integer type to a float type with the same size and vice | ||
// versa. Only single integer and float types are supported. | ||
Type reinterpretType() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be just reinterpret
I think, as that it's on a Type is now implicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/wasm-type.h
Outdated
FeatureSet getFeatures() const; | ||
|
||
// Returns a type based on its size in bytes and whether it is a float type. | ||
static Type getType(unsigned byteSize, bool float_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise this can be Type::get()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Several type-related functions currently exist outside of
Type
class and thus in the
wasm
, effectively global, namespace. This movesthese functions into
Type
class, making them either member functionsor static functions.
Also this renames
getSize
togetByteSize
to make it not to beconfused with
size
, which returns the number of types in multipletypes. This also reorders the order of functions in
wasm-type.cpp
tomatch that of
wasm-type.h
.