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 15 #ifndef DEP_H_ 16 #define DEP_H_ 17 18 #include <string> 19 #include <unordered_map> 20 #include <vector> 21 22 #include "loc.h" 23 #include "string_piece.h" 24 #include "symtab.h" 25 26 class Evaluator; 27 class Rule; 28 class Value; 29 class Var; 30 class Vars; 31 32 struct DepNode { 33 DepNode(Symbol output, bool is_phony, bool is_restat); 34 35 Symbol output; 36 vector<Value*> cmds; 37 vector<DepNode*> deps; 38 vector<DepNode*> order_onlys; 39 vector<DepNode*> parents; 40 bool has_rule; 41 bool is_default_target; 42 bool is_phony; 43 bool is_restat; 44 vector<Symbol> actual_inputs; 45 vector<Symbol> actual_order_only_inputs; 46 Vars* rule_vars; 47 Var* depfile_var; 48 Var* ninja_pool_var; 49 Symbol output_pattern; 50 Loc loc; 51 }; 52 53 void InitDepNodePool(); 54 void QuitDepNodePool(); 55 56 void MakeDep(Evaluator* ev, 57 const vector<const Rule*>& rules, 58 const unordered_map<Symbol, Vars*>& rule_vars, 59 const vector<Symbol>& targets, 60 vector<DepNode*>* nodes); 61 62 #endif // DEP_H_ 63