]> git.tdb.fi Git - builder.git/blobdiff - source/analyzer.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / analyzer.h
diff --git a/source/analyzer.h b/source/analyzer.h
deleted file mode 100644 (file)
index 4c9e146..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef ANALYZER_H_
-#define ANALYZER_H_
-
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-
-class Builder;
-class Target;
-
-/**
-Performs various kinds of dependency analysis on the build tree.
-*/
-class Analyzer
-{
-public:
-       enum Mode
-       {
-               DEPS,     //< Skip over "trivial" targets such as InstalledFile
-               ALLDEPS,  //< Print out absolutely every target
-               REBUILD,  //< Print targets that are going to be rebuilt
-               RDEPS     //< Print targets that depend on the given targets
-       };
-
-private:
-       using TableRow = std::vector<std::string>;
-
-       Builder &builder;
-       Mode mode;
-       std::vector<TableRow> table;
-       unsigned max_depth;
-       bool full_paths;
-       std::map<const Target *, std::set<Target *> > rdepends;
-
-public:
-       Analyzer(Builder &);
-
-       void set_mode(Mode m) { mode = m; }
-       void set_max_depth(unsigned m) { max_depth = m; }
-       void set_full_paths(bool f) { full_paths = f; }
-
-       /// Performs the analysis and prints out the resulting dependency tree.
-       void analyze();
-
-private:
-       /** Adds rows for a target, then recursively adds rows for dependencies as
-       needed. */
-       void build_depend_table(Target &, unsigned);
-
-       /// Prints out the table that resulted from the analysis.
-       void print_table() const;
-
-       static bool target_order(const Target *, const Target *);
-       static bool target_order_full(const Target *, const Target *);
-};
-
-#endif