On Wed, 2 Nov 2005, Jeffrey A Law wrote:
On Wed, 2005-11-02 at 12:01 -0600, Chris Lattner wrote:
[ ... big snip ... ]
For users like myself, I would really like to have an option to switch the
unused var warning to be emitted from the *front-end* where it works when
compiling with optimization disabled (a huge feature in itself) and where
the warnings are more stable. I know that it is impossible to guarantee
that GCC will ever match "other compilers", and that there will be false
positives (e.g. double diamond patterns), but for many uses this is
perfectly fine (other compilers warn about the same cases, so these cases
already have initializers).
I think it's worth noting that we build the SSA form even when we're
not optimizing. Which in turn with running the maybe-uninitialized
warning code early would give you the warnings you expect without
needing to run the optimizers. That's why I don't think we need to push
these warnings into the front-ends.
Sure, running it as the first stage of the optimizers has the effect of
making it have the properties I desire, without requiring the front-ends
to duplicate the code. Such a feature would be great to have!
-Chris
--
http://nondot.org/sabre/
http://llvm.org/