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]

Re: [PATCH] Set correct source location for deallocator calls


On 08/10/2012 01:21 PM, Dehao Chen wrote:
gimplify.c (gimplify_call_expr)
2486      /* For reliable diagnostics during inlining, it is necessary that
2487         every call_expr be annotated with file and line.  */
2488      if (! EXPR_HAS_LOCATION (*expr_p))
2489        SET_EXPR_LOCATION (*expr_p, input_location);

Shall we remove this code? Because I don't expect the location to be
unknown in other cases.

The code above is unnecessary for C++, because build_cxx_call already sets the location on CALL_EXPRs:


  /* Remember roughly where this call is.  */
  location_t loc = EXPR_LOC_OR_HERE (fn);
  fn = build_call_a (fn, nargs, argarray);
  SET_EXPR_LOCATION (fn, loc);

I don't know about other front ends.


Jason


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