Author: shenruifen
Date: 2011-10-12 02:54:09 -0400 (Wed, 12 Oct 2011)
New Revision: 3760

Modified:
   trunk/osprey/be/com/erbe.desc
   trunk/osprey/be/opt/opt_dce.cxx
   trunk/osprey/common/com/symtab.cxx
   trunk/osprey/common/com/symtab_access.h
   trunk/osprey/common/com/symtab_defs.h
   trunk/osprey/wgen/wgen_spin_symbol.cxx
Log:
Fix [Bug 879]: Missing line number of uninitialized variable warning

C.R. by Sun Chan



Modified: trunk/osprey/be/com/erbe.desc
===================================================================
--- trunk/osprey/be/com/erbe.desc       2011-10-12 05:33:39 UTC (rev 3759)
+++ trunk/osprey/be/com/erbe.desc       2011-10-12 06:54:09 UTC (rev 3760)
@@ -274,7 +274,7 @@
     3, ET_STRING, ET_INT, ET_STRING, 0,0,0 },
 
   { EC_Uninitialized,  EM_User | ES_WARNING, RAG_EN_NONE,
-    "Variable %s in %s might be used uninitialized",
+    "Variable %s in fucntion %s might be used uninitialized",
     2, ET_STRING, ET_STRING, 0,0,0,0 },
 
   /* DRA cloning errors */

Modified: trunk/osprey/be/opt/opt_dce.cxx
===================================================================
--- trunk/osprey/be/opt/opt_dce.cxx     2011-10-12 05:33:39 UTC (rev 3759)
+++ trunk/osprey/be/opt/opt_dce.cxx     2011-10-12 06:54:09 UTC (rev 3760)
@@ -5297,7 +5297,7 @@
       }
     }
 
-    ErrMsg(EC_Uninitialized, output_var_name, Cur_PU_Name);
+    ErrMsgLine(EC_Uninitialized, ST_Line(*(sym->St())), output_var_name, 
output_pu_name);
     if (p != NULL && p != Cur_PU_Name)
       free(p);
     if (v != NULL && v != &Str_Table[sym->St()->u1.name_idx])

Modified: trunk/osprey/common/com/symtab.cxx
===================================================================
--- trunk/osprey/common/com/symtab.cxx  2011-10-12 05:33:39 UTC (rev 3759)
+++ trunk/osprey/common/com/symtab.cxx  2011-10-12 06:54:09 UTC (rev 3760)
@@ -1835,6 +1835,9 @@
            fprintf (f, "Alignment: %d bytes", TY_align (ty_idx));
        }
        fprintf (f, "\n");
+       extern char *Orig_Src_File_Name, *Src_File_Name;
+       fprintf (f, "\t\tlocation: file %s, line %d\n", 
+                (Orig_Src_File_Name ? Orig_Src_File_Name : Src_File_Name), 
line);
 
        fprintf (f, "\t\tFlags:\t0x%08x", flags);
        if (flags) {

Modified: trunk/osprey/common/com/symtab_access.h
===================================================================
--- trunk/osprey/common/com/symtab_access.h     2011-10-12 05:33:39 UTC (rev 
3759)
+++ trunk/osprey/common/com/symtab_access.h     2011-10-12 06:54:09 UTC (rev 
3760)
@@ -243,6 +243,11 @@
 inline void
 Set_ST_vtable_ty_idx (ST& s, TY_IDX idx)       { s.vtable_ty_idx = idx; }
 
+inline mUINT32
+ST_Line (const ST& s)    { return s.line; }
+inline void
+Set_ST_Line (ST& s, mUINT32 lineno)    { s.line = lineno; }
+
 inline ST*
 ST_ptr (ST_IDX idx)                     { return &(St_Table[idx]); }
 

Modified: trunk/osprey/common/com/symtab_defs.h
===================================================================
--- trunk/osprey/common/com/symtab_defs.h       2011-10-12 05:33:39 UTC (rev 
3759)
+++ trunk/osprey/common/com/symtab_defs.h       2011-10-12 06:54:09 UTC (rev 
3760)
@@ -259,6 +259,8 @@
 
     TY_IDX vtable_ty_idx;
 
+    mUINT32 line;           // The line num where define the sym in the source 
file.
+
     // operations
     
     ST ()  {Fail_FmtAssertion("ST default constructor must not be called.");}

Modified: trunk/osprey/wgen/wgen_spin_symbol.cxx
===================================================================
--- trunk/osprey/wgen/wgen_spin_symbol.cxx      2011-10-12 05:33:39 UTC (rev 
3759)
+++ trunk/osprey/wgen/wgen_spin_symbol.cxx      2011-10-12 06:54:09 UTC (rev 
3760)
@@ -1895,6 +1895,13 @@
        if (st)
          return st;
         st = New_ST (level);
+
+        // Set line number where define sym in source file
+        if (gs_operand (decl_node, GS_DECL_SOURCE_LINE))
+          Set_ST_Line(*st, gs_decl_source_line(decl_node));
+        else
+          Set_ST_Line(*st, 0);
+
         if (TY_kind (ty_idx) == KIND_ARRAY &&
             gs_tree_static (decl_node) &&
             gs_decl_initial (decl_node) == FALSE &&


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to