Hi!
I am trying to write a small rewriting tool to perform automatic "hadlification" of the raw pointers. Among other things it means I need to rewrite signatures like:
X* foo(Y*, Z*);
into
Result<X> foo(Y*, Handle<Z>)
if X and Z are heap allocated objects and Y is not.
Unfortunately I can't figure out a way to get to X* source locations in the declaration above after I have matched CXXMethodDecl as whole.
I guess I could get to Z* by getting ParamVarDecl and asking getTypeSourceInfo of it (I have not tried it yet) but I can't see anything similar for result type.
Am I doing it wrong?
--
Vyacheslav Egorov