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: [C++ PATCH] Fix up DECL_ARG_TYPE (PR c++/36631)


Jason Merrill wrote:
> Mark Mitchell wrote:
>> That may be -- but I think the basic point remains true.  DECL_ARG_TYPE
>> is not a front-end concept.  It's an implementation detail, describing
>> how exactly the argument is passed.  As such, it really should be left
>> to the middle-end to compute as needed.
> 
> Well, it depends on the ABI, which can be language-specific.

Indeed, but this seems to me like an appropriate place for a langhook,
if one is required.  It's language-specific information that's required
as part of the lowering process from language-specific trees to GENERIC
and/or GIMPLE.

I guess my basic point is that by deferring this until that point, we're
guaranteed to avoid problems with incomplete types.  If we try to do it
before the translation unit is completely processed, then we're at risk
of getting it wrong.  So, a lazy approach (whether by making
DECL_ARG_TYPE itself actually invoke a hook if the value is NULL, or by
doing it at the point of gimplification, or some other strategy) seems
safest.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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