From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoBRZ-0005it-QH for qemu-devel@nongnu.org; Thu, 07 Apr 2016 11:02:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoBRV-0003Oh-NJ for qemu-devel@nongnu.org; Thu, 07 Apr 2016 11:02:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoBRV-0003Ob-IN for qemu-devel@nongnu.org; Thu, 07 Apr 2016 11:01:57 -0400 References: <87r3fjpvgx.fsf@fimbulvetr.bsc.es> <56E046D3.2080709@twiddle.net> <87twkfo6tn.fsf@fimbulvetr.bsc.es> <56E0714F.1090602@twiddle.net> <878u1rnv36.fsf@fimbulvetr.bsc.es> <8737rujz5n.fsf@fimbulvetr.bsc.es> <871t7dh71t.fsf@blackfin.pond.sub.org> <87mvpa4zcc.fsf@fimbulvetr.bsc.es> From: Paolo Bonzini Message-ID: <57067660.8030700@redhat.com> Date: Thu, 7 Apr 2016 17:01:52 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] [tcg] Idea on refactoring target code generation loop (gen_intermediate_code) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Markus Armbruster , Peter Crosthwaite , QEMU Developers , Richard Henderson On 07/04/2016 16:49, Peter Maydell wrote: > > QOM to C++ classes > I suspect if you looked at this you'd find that the QOM semantics > for various things don't map onto C++ (ie that we have more runtime > flexibility than C++ does). True, but you don't have to use it. :) If your code is static, one could imagine bindings to C++ that eliminate some of the boilerplate. Don't look at me, though. On the other hand, minimal usage of templates instead of some of the preprocessor gunk we have would be a very good thing IMNSHO. I am referring to the multiply included header files and to the macros with type arguments (mostly QOM casts). I don't think we need more C++ than that, but using templates as basically a type-safe preprocessor would improve QEMU a little bit. More rarely, lambdas could replace some preprocessor magic too, but that's C11 and not many compilers support them. But I won't weep if people say no because we have a lot other low-hanging fruit to make QEMU better (especially the header file cleanups that Markus started and I want to conclude very early in 2.7). Paolo > This is just vaguely remembered from > discussions back when we first added QOM though, I have no specific > detail and might have misremembered.