blob: 8dbda6a852b34989582079ab5a2e788f9d97537b [file] [log] [blame]
Shinichiro Hamaji1d545aa2015-06-23 15:29:13 +09001// Copyright 2015 Google Inc. All rights reserved
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Shinichiro Hamaji776ca302015-06-06 03:52:48 +090015#ifndef DEP_H_
16#define DEP_H_
17
Shinichiro Hamaji0562c302015-06-19 15:30:49 +090018#include <memory>
Shinichiro Hamaji776ca302015-06-06 03:52:48 +090019#include <string>
20#include <unordered_map>
21#include <vector>
22
23#include "loc.h"
24#include "string_piece.h"
25
26class Rule;
27class Value;
28class Vars;
29
30struct DepNode {
31 DepNode(StringPiece output, bool is_phony);
32
33 StringPiece output;
34 vector<Value*> cmds;
35 vector<DepNode*> deps;
36 vector<DepNode*> parents;
37 bool has_rule;
38 bool is_order_only;
39 bool is_phony;
40 vector<StringPiece> actual_inputs;
41 Vars* target_specific_vars;
42 Loc loc;
43};
44
45void InitDepNodePool();
46void QuitDepNodePool();
47
Shinichiro Hamaji0562c302015-06-19 15:30:49 +090048void MakeDep(const vector<shared_ptr<Rule>>& rules,
Shinichiro Hamaji776ca302015-06-06 03:52:48 +090049 const Vars& vars,
50 const unordered_map<StringPiece, Vars*>& rule_vars,
51 const vector<StringPiece>& targets,
52 vector<DepNode*>* nodes);
53
54#endif // DEP_H_