31 return LoadDyndeps(node, &ddf, err);
35 std::string* err)
const {
40 EXPLAIN(
"loading dyndep file '%s'", node->
path().c_str());
41 if (!LoadDyndepFile(node, ddf, err))
45 std::vector<Edge*>
const& out_edges = node->
out_edges();
46 for (std::vector<Edge*>::const_iterator oe = out_edges.begin();
47 oe != out_edges.end(); ++oe) {
48 Edge*
const edge = *oe;
52 DyndepFile::iterator ddi = ddf->find(edge);
53 if (ddi == ddf->end()) {
54 *err = (
"'" + edge->
outputs_[0]->path() +
"' " 55 "not mentioned in its dyndep file " 56 "'" + node->
path() +
"'");
60 ddi->second.used_ =
true;
61 Dyndeps const& dyndeps = ddi->second;
62 if (!UpdateEdge(edge, &dyndeps, err)) {
68 for (DyndepFile::const_iterator oe = ddf->begin(); oe != ddf->end();
70 if (!oe->second.used_) {
71 Edge*
const edge = oe->first;
72 *err = (
"dyndep file '" + node->
path() +
"' mentions output " 73 "'" + edge->
outputs_[0]->path() +
"' whose build statement " 74 "does not have a dyndep binding for the file");
83 std::string* err)
const {
97 for (std::vector<Node*>::const_iterator i =
100 if ((*i)->in_edge() != NULL) {
101 *err =
"multiple rules generate " + (*i)->path();
104 (*i)->set_in_edge(edge);
114 for (std::vector<Node*>::const_iterator i =
117 (*i)->AddOutEdge(edge);
123 std::string* err)
const {
125 return parser.
Load(file->
path(), err);
std::vector< Node * > implicit_inputs_
Store data loaded from one dyndep file.
Information about a node in the dependency graph: the file, whether it's dirty, mtime, etc.
std::vector< Node * > outputs_
bool Load(const std::string &filename, std::string *err, Lexer *parent=NULL)
Load and parse a file.
An edge in the dependency graph; links between Nodes using Rules.
const std::string & path() const
Store dynamically-discovered dependency information for one edge.
void set_dyndep_pending(bool pending)
bool LoadDyndepFile(Node *file, DyndepFile *ddf, std::string *err) const
std::vector< Node * > inputs_
void AddBinding(const std::string &key, const std::string &val)
const std::vector< Edge * > & out_edges() const
bool UpdateEdge(Edge *edge, Dyndeps const *dyndeps, std::string *err) const
bool LoadDyndeps(Node *node, std::string *err) const
Load a dyndep file from the given node's path and update the build graph with the new information...
std::vector< Node * > implicit_outputs_