-
Notifications
You must be signed in to change notification settings - Fork 752
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
Refactor optimization opts #1023
Conversation
I believe this is something @jfbastien suggested a while ago. |
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.
Woo! Lgtm
src/tools/optimization-options.h
Outdated
namespace wasm { | ||
|
||
struct OptimizationOptions : public Options { | ||
const std::string DEFAULT_OPT_PASSES = "O"; |
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.
static 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.
Hmm, that does sound like a good idea, but when I try it I get
in-class initialization of static data member ‘const string wasm::OptimizationOptions::DEFAULT_OPT_PASSES’ of non-literal type
call to non-constexpr function
I tried changing it to a const char*
but it still complains about
error: ‘constexpr’ needed for in-class initialization of static data member ‘const char* wasm::OptimizationOptions::DEFAULT_OPT_PASSES’ of non-integral type
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 works:
static constexpr char DEFAULT_OPT_PASSES[] = "O";
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.
Thanks, updated.
Adds a nice class instead of hackish inline-c-include of a header.