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

Refactor optimization opts #1023

Merged
merged 3 commits into from
May 24, 2017
Merged

Refactor optimization opts #1023

merged 3 commits into from
May 24, 2017

Conversation

kripken
Copy link
Member

@kripken kripken commented May 23, 2017

Adds a nice class instead of hackish inline-c-include of a header.

@kripken
Copy link
Member Author

kripken commented May 23, 2017

I believe this is something @jfbastien suggested a while ago.

Copy link
Contributor

@jgravelle-google jgravelle-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo! Lgtm

namespace wasm {

struct OptimizationOptions : public Options {
const std::string DEFAULT_OPT_PASSES = "O";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static const?

Copy link
Member Author

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

Copy link
Contributor

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";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated.

@kripken kripken merged commit c977ef7 into master May 24, 2017
@kripken kripken deleted the refactor-optimization-opts branch May 24, 2017 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants