Use policies for code generation
authorKeith Seitz <keiths@redhat.com>
Fri, 10 Aug 2018 18:01:24 +0000 (11:01 -0700)
committerKeith Seitz <keiths@redhat.com>
Fri, 10 Aug 2018 18:14:25 +0000 (11:14 -0700)
commitad3a68e9b9b01fbdc09854fb7fd655db652c482f
treea24d65fa792e3793a0de86ad29aaf32f920944f7
parent0cfbf43085c4191f3f4b4b4a834f1e19bf42d4a9
Use policies for code generation

This patch changes code generation procedures add_code_header,
add_code_footer, and several other language-specific code generation
functions into policies.

gdb/ChangeLog:
        * compile/compile-c-support.c (add_code_header, add_code_footer):
        Move into policy class.
        (c_push_user_expression, pop_user_expression_nop)
        (c_add_code_header, c_add_code_footer, c_add_input): New policy class.
        (compile_program): New host class.
        (c_compile_program): New typedef.
        (c_compute_porgram): Use c_compile_program.
gdb/ChangeLog
gdb/compile/compile-c-support.c