================
@@ -88,6 +102,22 @@ class OriginManager {
llvm::DenseMap<const clang::ValueDecl *, OriginID> DeclToOriginID;
llvm::DenseMap<const clang::Expr *, OriginID> ExprToOriginID;
};
+
+/// An utility class to traverse the function body in the analysis
+/// context and collect the count of expressions with missing origins.
+class MissingOriginCollector
+ : public RecursiveASTVisitor<MissingOriginCollector> {
+public:
+ MissingOriginCollector(const OriginManager &om,
+ llvm::StringMap<unsigned> &MissingOriginCount)
+ : OM(om), MissingOriginCount(MissingOriginCount) {}
+ bool VisitExpr(Expr *E);
+
+private:
+ const OriginManager &OM;
+ llvm::StringMap<unsigned> &MissingOriginCount;
+};
----------------
usx95 wrote:
Please move this to Origins.cpp (in anonymous namespace).
This is an internal detail to Origins.cpp
https://github.com/llvm/llvm-project/pull/166568
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits