cmd/compile: add -msan option
The -msan option causes the compiler to add instrumentation for the
C/C++ memory sanitizer. Every memory read/write will be preceded by
a call to msanread/msanwrite.
This CL passes tests but is not usable by itself. The actual
implementation of msanread/msanwrite in the runtime package, and support
for -msan in the go tool and the linker, and tests, will follow in
subsequent CLs.
Change-Id: I3d517fb3e6e65d9bf9433db070a420fd11f57816
Reviewed-on: https://go-review.googlesource.com/16160
Reviewed-by: David Crawshaw <crawshaw@golang.org>
diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go
index f0a1ddc..b1068dc 100644
--- a/src/cmd/compile/internal/gc/walk.go
+++ b/src/cmd/compile/internal/gc/walk.go
@@ -3037,7 +3037,7 @@
}
// General case, with no function calls left as arguments.
- // Leave for gen, except that race detector requires old form
+ // Leave for gen, except that instrumentation requires old form.
if !instrumenting {
return n
}