[cfe-dev] Use clang tool to do template instantiation

Hongbin Zheng via cfe-dev cfe-dev at lists.llvm.org
Sat Jan 28 10:58:05 PST 2017


Hi fe-dev,

Recently I am looking to use clang tool to do template instantiation based
on some command line parameter.

E.g.  given template

template<int N>
static int f(int a) { return a + N; }

by providing the name of function and the list of template parameter, i.e.
f and 4 for the tool, the tool should generate the following cpp file:

template<int N>
static int f(int a) { return a + N; }

static int f_4(int a) { return a + 4; }

Is there any example in clang?
which part of clang I should look at?

Thanks
Hongbin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170128/bf045320/attachment.html>


More information about the cfe-dev mailing list