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 0/6] Conversion of gimple types to C++ inheritance (v3)


On 11/05/13 14:57, David Malcolm wrote:

Thanks for looking through this.

Both you and Andrew objected to my use of the is-a.h stuff.  Is this due
to the use of C++ templates in that code?   If I were to rewrite things
in a more C idiom, would that be acceptable?
I can't speak for Andrew, but my experience with this kind of object type casting in a large C++ project is that it's a red flag for a design problem.

You could certainly argue that the design problem already exists. You could further argue that what you're doing is marking those warts visible in the code rather than in the data structures. Whether or not that's a good thing I haven't pondered much.

For me personally it's less about the syntax. Others may have other opinions. I strongly suggest they chime in with them ;-)


Maybe.  If the above idea is still too far, we could keep the
GIMPLE_CHECK checking, and cast by hand.  I suspect the results would be
more ugly (though it's clear that beauty is in the eye of the beholder
here :))

BTW, how do you feel about static_cast<> vs C-style casts?
Dislike them both :-)

jeff


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