summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-26 16:06:09 +0000
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-26 16:06:09 +0000
commit8c3e8d6881fea782e6381dc2621e6da05f84ccd4 (patch)
treeb94bed7986e2724eb7508e1ebf3f157968133e57 /gcc/tree-ssa.c
parent129f9079a12d24650cb2ecf42e4e4cc75d05bbc3 (diff)
downloadgcc-8c3e8d6881fea782e6381dc2621e6da05f84ccd4.tar.gz
Implement -Wno-maybe-uninitialized
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 7f0a077b044..9ae280a7e32 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1617,10 +1617,11 @@ walk_use_def_chains (tree var, walk_use_def_chains_fn fn, void *data,
changed conditionally uninitialized to unconditionally uninitialized. */
/* Emit a warning for T, an SSA_NAME, being uninitialized. The exact
- warning text is in MSGID and LOCUS may contain a location or be null. */
+ warning text is in MSGID and LOCUS may contain a location or be null.
+ WC is the warning code. */
void
-warn_uninit (tree t, const char *gmsgid, void *data)
+warn_uninit (enum opt_code wc, tree t, const char *gmsgid, void *data)
{
tree var = SSA_NAME_VAR (t);
gimple context = (gimple) data;
@@ -1644,7 +1645,7 @@ warn_uninit (tree t, const char *gmsgid, void *data)
: DECL_SOURCE_LOCATION (var);
xloc = expand_location (location);
floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl));
- if (warning_at (location, OPT_Wuninitialized, gmsgid, var))
+ if (warning_at (location, wc, gmsgid, var))
{
TREE_NO_WARNING (var) = 1;
@@ -1726,10 +1727,12 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
/* We only do data flow with SSA_NAMEs, so that's all we
can warn about. */
if (data->always_executed)
- warn_uninit (t, "%qD is used uninitialized in this function",
+ warn_uninit (OPT_Wuninitialized,
+ t, "%qD is used uninitialized in this function",
data->stmt);
else if (data->warn_possibly_uninitialized)
- warn_uninit (t, "%qD may be used uninitialized in this function",
+ warn_uninit (OPT_Wuninitialized,
+ t, "%qD may be used uninitialized in this function",
data->stmt);
*walk_subtrees = 0;
break;