diff --git a/lib/astutils.cpp b/lib/astutils.cpp index f132ec44b..5f22ce05b 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -1178,11 +1178,3 @@ const Token *FwdAnalysis::reassign(const Token *expr, const Token *startToken, c Result result = check(expr, startToken, endToken); return result.type == FwdAnalysis::Result::Type::WRITE ? result.token : nullptr; } - -std::vector FwdAnalysis::reads(const Token *expr, const Token *startToken, const Token *endToken) -{ - mReassign = false; - mReads.clear(); - check(expr, startToken, endToken); - return mReads; -} diff --git a/lib/astutils.h b/lib/astutils.h index 3e1c7ec5d..6abc6623a 100644 --- a/lib/astutils.h +++ b/lib/astutils.h @@ -175,20 +175,11 @@ public: */ const Token *reassign(const Token *expr, const Token *startToken, const Token *endToken); - /** - * Get tokens where "expr" is read. The "expr" can be a tree (x.y[12]). - * @param expr Symbolic expression to perform forward analysis for - * @param startToken First token in forward analysis - * @param endToken Last token in forward analysis - * @return vector of read tokens - */ - std::vector reads(const Token *expr, const Token *startToken, const Token *endToken); - private: /** Result of forward analysis */ struct Result { enum class Type { NONE, READ, WRITE, BREAK, RETURN, BAILOUT } type; - Result(Type type) : type(type), token(nullptr) {} + explicit Result(Type type) : type(type), token(nullptr) {} Result(Type type, const Token *token) : type(type), token(token) {} const Token *token; };