On Mon, Jun 4, 2012 at 4:58 PM, Manuel López-Ibáñez <lopeziba...@gmail.com> wrote: >> Yes, that would be the ideal case. But some target dependencies are >> inevitable, e.g. the target CPP macros. What I'd like to see >> eventually, is that targetm will be split up in front end and >> middle/back end specific parts. > > Well, the CPP macros could be translated to builtin calls and > evaluated by the middle-end during or after gimplification. Then the > FE would be really independent of the back-end. Sounds crazy?
I'm not sure this would work. Say you have a target that defines cpu models (see e.g. ix86_target_macros) and you're parsing a file that depend on those defines. You're going to have to export those those cpu model defines to make parsing work. I think this can only be done with call-backs from the front end to a back-end target hook. But I haven't look at how e.g. clang handles such things, maybe there's another, better way. Ciao! Steven