Commit 7e1cacaa authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38440 from justinsb/conversion_gen_safe_at_some_speeds

Automatic merge from submit-queue conversion-gen: add --skip-unsafe flag We should expose the SkipUnsafe option, for legacy compatability, so that conversion-go can be used in other projects, and for platforms where unsafe is not available. Make unsafe code generation the default though, and have the help text hint that the resulting code is sub-optimal.
parents 01b9d496 dd351db7
...@@ -64,6 +64,8 @@ func main() { ...@@ -64,6 +64,8 @@ func main() {
} }
pflag.CommandLine.StringSliceVar(&customArgs.ExtraPeerDirs, "extra-peer-dirs", customArgs.ExtraPeerDirs, pflag.CommandLine.StringSliceVar(&customArgs.ExtraPeerDirs, "extra-peer-dirs", customArgs.ExtraPeerDirs,
"Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.") "Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.")
pflag.CommandLine.BoolVar(&customArgs.SkipUnsafe, "skip-unsafe", customArgs.SkipUnsafe,
"If true, will not generate code using unsafe pointer conversions; resulting code may be slower.")
arguments.CustomArgs = customArgs arguments.CustomArgs = customArgs
// Run it. // Run it.
......
...@@ -568,6 +568,7 @@ since-time ...@@ -568,6 +568,7 @@ since-time
skip-generated-rewrite skip-generated-rewrite
skip-munges skip-munges
skip-preflight-checks skip-preflight-checks
skip-unsafe
sort-by sort-by
source-file source-file
ssh-env ssh-env
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment