"strings"
)
-// Declaration stack & operations
+func EnableNoWriteBarrierRecCheck() {
+ nowritebarrierrecCheck = newNowritebarrierrecChecker()
+}
+
+func NoWriteBarrierRecCheck() {
+ // Write barriers are now known. Check the
+ // call graph.
+ nowritebarrierrecCheck.check()
+ nowritebarrierrecCheck = nil
+}
+
+var nowritebarrierrecCheck *nowritebarrierrecChecker
func testdclstack() {
if !types.IsDclstackValid() {
// timing data for compiler phases
var timings Timings
-var nowritebarrierrecCheck *nowritebarrierrecChecker
-
// Main parses flags and Go source files specified in the command-line
// arguments, type-checks the parsed Go package, compiles functions to machine
// code, and finally writes the compiled package definition to disk.
// We'll do the final check after write barriers are
// inserted.
if base.Flag.CompilingRuntime {
- nowritebarrierrecCheck = newNowritebarrierrecChecker()
+ EnableNoWriteBarrierRecCheck()
}
// Phase 7: Transform closure bodies to properly reference captured variables.
compileFunctions()
- if nowritebarrierrecCheck != nil {
- // Write barriers are now known. Check the
- // call graph.
- nowritebarrierrecCheck.check()
- nowritebarrierrecCheck = nil
+ if base.Flag.CompilingRuntime {
+ // Write barriers are now known. Check the call graph.
+ NoWriteBarrierRecCheck()
}
// Finalize DWARF inline routine DIEs, then explicitly turn off