| 1057 | //----------------------------------------------------------------------------- |
| 1058 | |
| 1059 | static const DeclRefExpr* FindVarDeclRef(const Stmt* stmt) |
| 1060 | { |
| 1061 | if(const auto* dref = dyn_cast_or_null<DeclRefExpr>(stmt)) { |
| 1062 | if(const auto* vd = dyn_cast_or_null<VarDecl>(dref->getDecl())) { |
| 1063 | return dref; |
| 1064 | } |
| 1065 | } |
| 1066 | |
| 1067 | if(stmt) { |
| 1068 | for(const auto* child : stmt->children()) { |
| 1069 | if(const auto* childRef = FindVarDeclRef(child)) { |
| 1070 | return childRef; |
| 1071 | } |
| 1072 | } |
| 1073 | } |
| 1074 | |
| 1075 | return nullptr; |
| 1076 | } |
| 1077 | //----------------------------------------------------------------------------- |
| 1078 | |
| 1079 | /* |
no test coverage detected