#include "typeInfo.h"\r
#include "visit.h"\r
\r
+// add a generic instantiation if its not in the vector already\r
void addGenericInstantiation(\r
std::vector<std::vector<Type>> & insts,\r
const std::vector<Type> & newInst)\r
\r
// Find generic instantiations\r
\r
+ // visit expressions (only function calls are considered) and types,\r
+ // find the function/struct by pointer and add an instantiation\r
Visitor findGenericInstantiations;\r
findGenericInstantiations.onExpr =\r
[&](const Expr & e, const std::shared_ptr<Context> ctx)\r
addGenericInstantiation(std::get<0>(*f)->genericInstantiations, e._func.genericInstantiation);\r
}\r
}\r
- // TODO: generic methods\r
};\r
findGenericInstantiations.onType =\r
[&](const Type & t, const std::shared_ptr<Context> ctx)\r
return result;\r
}\r
\r
+// generate the appendix for C struct/function names\r
+// including array/pointer indicators because\r
+// there might be distinct instantiations\r
+// for int and int* for example\r
std::string genericAppendix(const std::vector<Type> & ts)\r
{\r
std::stringstream sstr;\r