Skip to content

Refactor optimization opts#1023

Merged
kripken merged 3 commits into
masterfrom
refactor-optimization-opts
May 24, 2017
Merged

Refactor optimization opts#1023
kripken merged 3 commits into
masterfrom
refactor-optimization-opts

Conversation

@kripken

@kripken kripken commented May 23, 2017

Copy link
Copy Markdown
Member

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

@kripken

kripken commented May 23, 2017

Copy link
Copy Markdown
Member Author

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

@jgravelle-google jgravelle-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Woo! Lgtm

Comment thread src/tools/optimization-options.h Outdated
namespace wasm {

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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