Shinichiro Hamaji | 1d545aa | 2015-06-23 15:29:13 +0900 | [diff] [blame^] | 1 | // 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 Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 15 | #ifndef DEP_H_ |
| 16 | #define DEP_H_ |
| 17 | |
Shinichiro Hamaji | 0562c30 | 2015-06-19 15:30:49 +0900 | [diff] [blame] | 18 | #include <memory> |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 19 | #include <string> |
| 20 | #include <unordered_map> |
| 21 | #include <vector> |
| 22 | |
| 23 | #include "loc.h" |
| 24 | #include "string_piece.h" |
| 25 | |
| 26 | class Rule; |
| 27 | class Value; |
| 28 | class Vars; |
| 29 | |
| 30 | struct 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 | |
| 45 | void InitDepNodePool(); |
| 46 | void QuitDepNodePool(); |
| 47 | |
Shinichiro Hamaji | 0562c30 | 2015-06-19 15:30:49 +0900 | [diff] [blame] | 48 | void MakeDep(const vector<shared_ptr<Rule>>& rules, |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 49 | 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_ |