tools icon indicating copy to clipboard operation
tools copied to clipboard

go/analysis: enable change ssa.BuilderMode on buildssa Analyzer

Open sanposhiho opened this issue 4 years ago • 6 comments

Hello👋

This PR proposes to enable change ssa.BuilderMode on buildssa Analyzer.

Since there is currently no way to change BuilderMode, I created a public function CreateRunner so that it can replace buildssa.Analyzer.Run.

The original comment stated the following

// Some Analyzers may need GlobalDebug, in which case we'll have // to set it globally, but let's wait till we need it.

The static analyzer I'm developing, wastedassign, needed to use ssa.NaiveForm mode. With the variety of great static analysis tools being developed, I think it should be possible to change the mode. It's time to enable to set mode globally.

sanposhiho avatar Jan 16 '21 07:01 sanposhiho

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] avatar Jan 16 '21 07:01 google-cla[bot]

@googlebot I signed it!

sanposhiho avatar Jan 16 '21 07:01 sanposhiho

This PR (HEAD: 1fce5fd24e8197842b138df40d7d7c01f405e68c) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/284219 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 16 '21 07:01 gopherbot

Message from Go Bot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps: A maintainer will review your change and provide feedback. See https://golang.org/doc/contribute.html#review for more info and tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be surprising to people new to the project. The careful, iterative review process is our way of helping mentor contributors and ensuring that their contributions have a lasting impact.


Please don’t reply on this GitHub thread. Visit golang.org/cl/284219. After addressing review feedback, remember to publish your drafts!

gopherbot avatar Jan 16 '21 08:01 gopherbot

I think this change requires more discussion. A proposal would be a good place for further discussion. Can you file a proposal for it following the steps here: https://github.com/golang/proposal#the-proposal-process on the Go issue tracker. The component for this change should be x/tools/go/analysis/passes/buildssa.

timothy-king avatar Jan 26 '21 22:01 timothy-king

Hello @timothy-king. OK, I will submit a proposal as you suggest and have a discussion. Thanks.

sanposhiho avatar Jan 30 '21 06:01 sanposhiho