Home | History | Annotate | Download | only in kati

Lines Matching refs:Rule

30 #include "rule.h"
49 void ApplyOutputPattern(const Rule& r,
76 Entry(const Rule* r, StringPiece s) : rule(r), suffix(s) {}
77 const Rule* rule;
88 void Add(StringPiece name, const Rule* rule) {
90 rules_.push_back(Entry(rule, name));
98 p.first->second->Add(name.substr(1), rule);
101 void Get(StringPiece name, vector<const Rule*>* rules) const {
105 rules->push_back(ent.rule);
134 // suffix rule.
143 vector<const Rule*> rules;
145 const Rule* primary_rule;
181 void AddRule(Symbol output, const Rule* r) {
212 void FillDepNodeFromRule(Symbol output, const Rule* r, DepNode* n) const {
226 void FillDepNodeLoc(const Rule* r, DepNode* n) const {
232 void FillDepNode(Symbol output, const Rule* pattern_rule, DepNode* n) const {
244 for (const Rule* r : rules) {
254 for (const Rule* r : implicit_output.second->rules) {
279 const vector<const Rule*>& rules,
352 for (const Rule* r : p.second.rules) {
398 for (const Rule* r : found->second.rules) {
405 void PopulateRules(const vector<const Rule*>& rules) {
406 for (const Rule* rule : rules) {
407 if (rule->outputs.empty()) {
408 PopulateImplicitRule(rule);
410 PopulateExplicitRule(rule);
437 bool PopulateSuffixRule(const Rule* rule, Symbol output) {
446 shared_ptr<Rule> r = make_shared<Rule>(*rule);
454 void PopulateExplicitRule(const Rule* rule) {
455 for (Symbol output : rule->outputs) {
459 rules_[output].AddRule(output, rule);
460 PopulateSuffixRule(rule, output);
464 static bool IsIgnorableImplicitRule(const Rule* rule) {
467 if (rule->inputs.size() != 1)
469 if (!rule->order_only_inputs.empty())
471 if (!rule->cmds.empty())
473 const string& i = rule->inputs[0].str();
478 void PopulateImplicitRule(const Rule* rule) {
479 for (Symbol output_pattern : rule->output_patterns) {
480 if (output_pattern.str() != "%" || !IsIgnorableImplicitRule(rule))
481 implicit_rules_->Add(output_pattern.str(), rule);
500 bool CanPickImplicitRule(const Rule* rule,
503 shared_ptr<Rule>* out_rule) {
505 for (Symbol output_pattern : rule->output_patterns) {
509 for (Symbol input : rule->inputs) {
527 *out_rule = make_shared<Rule>(*rule);
531 for (Symbol output_pattern : rule->output_patterns) {
562 shared_ptr<Rule>* pattern_rule,
576 vector<const Rule*> irules;
599 for (const shared_ptr<Rule>& irule : found->second) {
632 shared_ptr<Rule> pattern_rule;
720 typedef unordered_map<StringPiece, vector<shared_ptr<Rule>>> SuffixRuleMap;
733 const vector<const Rule*>& rules,