Better way obtaining dereference?

Dear All,

I would like to know is that a better way in Clang to obtain the number of UnaryOperator in UnaryOperatorClass Stmt (i.e., for ***a, return 3)?

Currently, I write a recursive function to strip the the UnaryOperator, until it reaches DeclRefExpr . Thanks.

Best,
Zong