David Blaikie wrote:
On Mon, Mar 16, 2015 at 6:18 PM, Nick Lewycky <[email protected] <mailto:[email protected]>> wrote: On 16 March 2015 at 18:06, Justin Bogner <[email protected] <mailto:[email protected]>> wrote: David Blaikie <[email protected] <mailto:[email protected]>> writes: > On Mar 16, 2015 4:57 PM, "Justin Bogner" <[email protected] <mailto:[email protected]>> wrote: > > > > Author: bogner > > Date: Mon Mar 16 18:52:21 2015 > > New Revision: 232439 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=232439&view=rev <http://llvm.org/viewvc/llvm-project?rev=232439&view=rev> > > Log: > > GCOV: Expose the -coverage-exit-block-before-body flag in clang -cc1 > > > > This exposes the optional exit block placement logic from r232438 as a > > clang -cc1 option. There is a test on the llvm side, but there isn't > > really a way to inspect the gcov options from clang to test it here as > > well. > > I'm missing something probably - what's the benefit of that over just using > -mllvm to pass this flag to llvm directly? (If I'm remembering how this stuff > works) I'm not sure - I was matching the -coverage-cfg-checksum and -coverage-no-function-names-in-data CC1 options here. Maybe Nick has thoughts? LLVM flags are global state which will carry from one TU to the next. Suppose you want to use clang as a library, and you want to pass flags for one TU, then parse another TU with different flags. It is an error to set the same LLVM flag twice, so that will terminate your program. In general the -mllvm flags are bad news and we should get rid of all of them and certainly not add new ones. I figured this flag was just as a utility for experiments - if it was for more than experiments I would imagine it'd need to come up to a frontend option, not just a -cc1 option, no?
It would be great to have a frontend option where you set what gcc version we want to emulate for gcov and it sets the right cc1 flags, but nobody has signed up for doing that yet.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
