Fatalf("caninl on non-typechecked function %v", fn)
}
- // Runtime package must not be instrumented.
- // Instrument skips runtime package. However, some runtime code can be
- // inlined into other packages and instrumented there. To avoid this,
- // we disable inlining of runtime functions when instrumenting.
- // The example that we observed is inlining of LockOSThread,
- // which lead to false race reports on m contents.
- if instrumenting && myimportpath == "runtime" {
- reason = "instrumenting and is runtime function"
- return
- }
-
n := fn.Func.Nname
if n.Func.InlinabilityChecked() {
return
return n
}
+ if instrumenting && isRuntimePkg(fn.Sym.Pkg) {
+ // Runtime package must not be instrumented.
+ // Instrument skips runtime package. However, some runtime code can be
+ // inlined into other packages and instrumented there. To avoid this,
+ // we disable inlining of runtime functions when instrumenting.
+ // The example that we observed is inlining of LockOSThread,
+ // which lead to false race reports on m contents.
+ return n
+ }
+
if Debug_typecheckinl == 0 {
typecheckinl(fn)
}
startProfile()
+ if flag_race && flag_msan {
+ log.Fatal("cannot use both -race and -msan")
+ }
+ if ispkgin(omit_pkgs) {
+ flag_race = false
+ flag_msan = false
+ }
if flag_race {
racepkg = types.NewPkg("runtime/race", "race")
}
if flag_msan {
msanpkg = types.NewPkg("runtime/msan", "msan")
}
- if flag_race && flag_msan {
- log.Fatal("cannot use both -race and -msan")
- } else if flag_race || flag_msan {
+ if flag_race || flag_msan {
instrumenting = true
}
+
if compiling_runtime && Debug['N'] != 0 {
log.Fatal("cannot disable optimizations while compiling runtime")
}