On Mon, Jun 29, 2015 at 5:09 PM, Justin Bogner <m...@justinbogner.com> wrote: > Diego Novillo <dnovi...@google.com> writes: >> >> + ``LLVM_PROFILE_FILE`` can be used to alter the directory and filename for >> the >> + profile file. For example, > > I'd reword this like > > ``LLVM_PROFILE_FILE`` can be used to override the directory and filename > for the profile file at runtime
Done. >> + Without any other arguments, ``-fprofile-use`` behaves identically to >> + ``-fprofile-instr-use``. Otherwise, if ``pathname`` is the full path to a >> + profile file, it reads from that file. If ``pathname`` is a directory >> name, >> + it reads from ``pathname/pgo-data``. > > Apparently we already default to pgo-data, and I actually added that > code, but I'd rather default to "default.profdata" to mirror > "default.profraw". It seems the behaviour with the pgo-data name is > completely undocumented and untested, so it should be fine to switch. Oh, good. Because I was not liking pgo-data all that much. >> + if ((Args.hasArg(options::OPT_fprofile_instr_generate) || >> + Args.hasArg(options::OPT_fprofile_instr_generate_EQ)) && >> + (Args.hasArg(options::OPT_fprofile_generate) || >> + Args.hasArg(options::OPT_fprofile_generate_EQ))) >> + D.Diag(diag::err_drv_argument_not_allowed_with) >> + << "-fprofile-instr-generate" << "-fprofile-generate"; >> + >> + if ((Args.hasArg(options::OPT_fprofile_instr_use) || >> + Args.hasArg(options::OPT_fprofile_instr_use_EQ)) && >> + (Args.hasArg(options::OPT_fprofile_use) || >> + Args.hasArg(options::OPT_fprofile_use_EQ))) >> + D.Diag(diag::err_drv_argument_not_allowed_with) >> + << "-fprofile-instr-use" << "-fprofile-use"; >> + >> if (Arg *A = Args.getLastArg(options::OPT_fprofile_instr_generate_EQ)) >> A->render(Args, CmdArgs); >> - else >> + else if (Arg *A = Args.getLastArg(options::OPT_fprofile_generate_EQ)) >> + A->render(Args, CmdArgs); >> + else if (Args.hasArg(options::OPT_fprofile_instr_generate)) >> Args.AddAllArgs(CmdArgs, options::OPT_fprofile_instr_generate); >> + else if (Args.hasArg(options::OPT_fprofile_generate)) >> + Args.AddAllArgs(CmdArgs, options::OPT_fprofile_generate); > > Hm, these (even before your change) behave kind of oddly when multiple > are specified. If someone specifies multiple forms it would probably > make more sense to accept the last one, rather than have certain forms > "win". > > We should use the getLastArg form that takes multiple arguments here and > consolidate these down to a single canonical form for -cc1. I'm canonicalizing -fprofile-instr-generate down to -fprofile-instr-generate=default.profraw. But this means that we will always generate a call to __llvm_profile_override_default_filename(). I don't mind that too much, but before I continue, I wanted to make sure you're OK with it. If not, I'll let -cc1 accept both -fprofile-instr-generate and -fprofile-instr-generate=. Diego. _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits