OSDN Git Service

Patch from Alex Petit-Bianco.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 May 1998 17:32:40 +0000 (17:32 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 May 1998 17:32:40 +0000 (17:32 +0000)
* expr.c (expand_expr, case EXPR_WITH_FILE_LOCATION): Save/restore
input_filename and lineno around expand_expr call.  Set them to values
in WFL before expand_expr call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19778 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index 725b7e3..d4023be 100644 (file)
@@ -1,3 +1,9 @@
+Fri May 15 17:26:18 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * expr.c (expand_expr, case EXPR_WITH_FILE_LOCATION): Save/restore
+       input_filename and lineno around expand_expr call.  Set them to values
+       in WFL before expand_expr call.
+
 Fri May 15 12:44:57 1998  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
 
        * stor-layout.c (set_sizetype): Set TYPE_NAME on bitsizetype.
index dcbde15..34f744d 100644 (file)
@@ -5171,9 +5171,20 @@ expand_expr (exp, target, tmode, modifier)
       return TREE_CST_RTL (exp);
 
     case EXPR_WITH_FILE_LOCATION:
-      if (EXPR_WFL_EMIT_LINE_NOTE (exp))
-       emit_line_note (EXPR_WFL_FILENAME (exp), EXPR_WFL_LINENO (exp));
-      return expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
+      {
+       rtx to_return;
+       char *saved_input_filename = input_filename;
+       int saved_lineno = lineno;
+       input_filename = EXPR_WFL_FILENAME (exp);
+       lineno = EXPR_WFL_LINENO (exp);
+       if (EXPR_WFL_EMIT_LINE_NOTE (exp))
+         emit_line_note (input_filename, lineno);
+       /* Possibly avoid switching back and force here */
+       to_return = expand_expr (EXPR_WFL_NODE (exp), target, tmode, modifier);
+       input_filename = saved_input_filename;
+       lineno = saved_lineno;
+       return to_return;
+      }
 
     case SAVE_EXPR:
       context = decl_function_context (exp);