<div dir="ltr"><span style="font-size:12.8px">Hi fe-dev,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Recently I am looking to use clang tool to do template instantiation based on some command line parameter.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">E.g.  given template</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">template<int N></div><div style="font-size:12.8px">static int f(int a) { return a + N; }</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">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:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>template<int N></div><div>static int f(int a) { return a + N; }</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">static int f_4(int a) { return a + 4; }</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Is there any example in clang?</div><div style="font-size:12.8px">which part of clang I should look at?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks</div><div style="font-size:12.8px">Hongbin</div></div>