This will allow the output directory to be specified by a build time
option, similar to the directory specified for regular PGO profiles via
-fprofile-generate=. The memory profiling instrumentation pass will
set up the variable. This is the same mechanism used by the PGO
instrumentation and runtime.
Additionally, change the default of the log_path flag to nullptr, and
the code consuming that flag (ReportFile::SetReportPath) to treat
nullptr as stderr (so no change to the behavior of existing users).
This is so the flag can be used to override the new variable encoded in
the binary for runtime testing.
Finally, in preparation for a follow on change to clang which will
always specify an output filename via the new variable, change the
existing memprof tests to specify log_path=stderr when that was being
Depends on D87120.