templatize cpp_generator::print_method_{decl,impl}
commit1b11de4e6f1f4cabbd53eaccf710674ea8599869
authorSven Verdoolaege <sven@cerebras.net>
Tue, 20 Nov 2018 16:58:47 +0000 (20 17:58 +0100)
committerSven Verdoolaege <sven@cerebras.net>
Fri, 29 Mar 2019 15:38:28 +0000 (29 16:38 +0100)
tree89ae92b72dcce6d3717753236bbecf459eadb288
parentdc81905d9ca0214bfc7c41b8c439a04171caf116
templatize cpp_generator::print_method_{decl,impl}

There is quite a bit of duplication between the logic
for printing method declarations and method implementations.
In order not to exacerbate this situation in the upcoming support
for automatically converting long arguments to isl::val,
the shared logic will be implemented in a method template.
This method will be called from a print_method_variants method template,
which needs to be able to call print_method_decl or print_method_impl
depending on the template parameter.
Turn these methods into (specialized) template methods for this purpose.

Signed-off-by: Sven Verdoolaege <sven@cerebras.net>
interface/cpp.cc
interface/cpp.h