Emitting code for instantiated templates


Is there a possibility in Clang to emit C++ code in which all templates have been instantiated? I would like to have a different source location
for each specific instantiation, such that I can use clang::Rewriter to
edit each instantiation separately.

For example:

template <typename T>
class A {
  T field;

int main() {
   A<int> a;
   A<float> b;

Would become something like:

class A_int {
   int field;

class A_float {
   float field;

int main() {
   A_int a;
   B_float b;