This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] locus fix



This is basically Jose's patch, slightly tweaked.

	* tree-flow-inline.h (get_lineno): Return -1 for nodes without
	locus information.
	(get_filename): Return "???" for nodes without locus information.

Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.18
diff -c -3 -p -r1.1.2.18 tree-flow-inline.h
*** tree-flow-inline.h	15 Jan 2003 19:41:47 -0000	1.1.2.18
--- tree-flow-inline.h	21 Jan 2003 17:27:35 -0000
*************** get_lineno (expr)
*** 245,250 ****
--- 245,253 ----
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
+   if (! TREE_LOCUS (expr))
+     return -1;
+ 
    return TREE_LINENO (expr);
  }
  
*************** get_filename (expr)
*** 258,264 ****
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
!   if (TREE_FILENAME (expr))
      return TREE_FILENAME (expr);
    else
      return "???";
--- 261,267 ----
    if (TREE_CODE (expr) == COMPOUND_EXPR)
      expr = TREE_OPERAND (expr, 0);
  
!   if (TREE_LOCUS (expr) && TREE_FILENAME (expr))
      return TREE_FILENAME (expr);
    else
      return "???";



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]