On Mon, Nov 04, 2013 at 08:54:40AM -0500, Andrew MacLeod wrote: > >>What checking? There ought to be no checking at all in this > >>example... gimple_build_call_vec returns a gimple_call, and > >>gimple_call_set_lhs() doesn't have to check anything because it > >>only accepts gimple_call's.. so there is no checking other than the > >>usual "does my parameter match" that the compiler has to do... > >and want to replace it by checking of the types at compile time. > >The problem is that it uglifies the source too much, and, when you > >actually don't have a gimple_call but supposedly a base class of it, > > But when you convert all the source base for gimple calls, then you > have context pretty much everywhere.. you wont be doing it from a > base class... at least pretty infrequently.
Usually you just have IL which contains various kinds of statements, it can be a call, assign, dozens of other gimple stmt forms. If you need to modify something in these, you'd need to uglify with as_a/is_a if you require everybody using these setters/getters to use gimple_call * rather than gimple, pointer to any kind of stmt. Jakub