Commit 58272d79 by Eric Botcazou Committed by Eric Botcazou

trans.c (gnat_to_gnu): Do not set source location info on NOP_EXPRs.

        * trans.c (gnat_to_gnu): Do not set source location info on NOP_EXPRs.
        (Sloc_to_locus): Do not overwrite known GCC locations when translating
        GNAT standard locations.

From-SVN: r135847
parent 7c88f67a
2008-05-24 Eric Botcazou <ebotcazou@adacore.com>
* trans.c (gnat_to_gnu): Do not set source location info on NOP_EXPRs.
(Sloc_to_locus): Do not overwrite known GCC locations when translating
GNAT standard locations.
2008-05-23 Eric Botcazou <ebotcazou@adacore.com> 2008-05-23 Eric Botcazou <ebotcazou@adacore.com>
* gigi.h (mark_visited): Declare. * gigi.h (mark_visited): Declare.
...@@ -4880,7 +4880,10 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4880,7 +4880,10 @@ gnat_to_gnu (Node_Id gnat_node)
the location information of their last use. Note that we may have the location information of their last use. Note that we may have
no result if we tried to build a CALL_EXPR node to a procedure with no result if we tried to build a CALL_EXPR node to a procedure with
no side-effects and optimization is enabled. */ no side-effects and optimization is enabled. */
if (gnu_result && EXPR_P (gnu_result) && !REFERENCE_CLASS_P (gnu_result)) if (gnu_result
&& EXPR_P (gnu_result)
&& TREE_CODE (gnu_result) != NOP_EXPR
&& !REFERENCE_CLASS_P (gnu_result))
set_expr_location_from_node (gnu_result, gnat_node); set_expr_location_from_node (gnu_result, gnat_node);
/* If we're supposed to return something of void_type, it means we have /* If we're supposed to return something of void_type, it means we have
...@@ -6853,6 +6856,7 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus) ...@@ -6853,6 +6856,7 @@ Sloc_to_locus (Source_Ptr Sloc, location_t *locus)
if (Sloc <= Standard_Location) if (Sloc <= Standard_Location)
{ {
if (*locus == UNKNOWN_LOCATION)
*locus = BUILTINS_LOCATION; *locus = BUILTINS_LOCATION;
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment