using c++ name mangling by hand


I'd like to compile some code that contains a function in a namespace (e.g. void MyNamespace::foo(int)).
How can I find out the mangled name of the function that I can find it in the resulting module?

Should I build up some declaration or should I track the toplevel decls and anaylze them which is my