[compiler-rt] r201808 - Add an environment variable to override the default profile output file.

Diego Novillo dnovillo at google.com
Fri Feb 21 06:17:59 PST 2014


On Thu, Feb 20, 2014 at 2:52 PM, Bob Wilson <bob.wilson at apple.com> wrote:
> Author: bwilson
> Date: Thu Feb 20 13:52:32 2014
> New Revision: 201808
>
> URL: http://llvm.org/viewvc/llvm-project?rev=201808&view=rev
> Log:
> Add an environment variable to override the default profile output file.
>
> Also rename the default output file from "pgo-data" to "default.profdata".
> The ".profdata" suffix is consistent with the name of the new llvm-profdata
> tool.
>
> Modified:
>     compiler-rt/trunk/lib/profile/PGOProfiling.c
>
> Modified: compiler-rt/trunk/lib/profile/PGOProfiling.c
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=201808&r1=201807&r2=201808&view=diff
> ==============================================================================
> --- compiler-rt/trunk/lib/profile/PGOProfiling.c (original)
> +++ compiler-rt/trunk/lib/profile/PGOProfiling.c Thu Feb 20 13:52:32 2014
> @@ -56,7 +56,10 @@ void llvm_pgo_register_writeout_function
>  }
>
>  void llvm_pgo_writeout_files() {
> -  OutputFile = fopen("pgo-data", "w");
> +  const char *OutputName = getenv("LLVM_PROFILE_FILE");

I was never very fond of environment variables. They lead to all kinds
of nasty and hidden side-effects. How about a flag?


Diego.



More information about the llvm-commits mailing list