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)
77 : rule(r), suffix(s) {
79 const Rule* rule;
90 void Add(StringPiece name, const Rule* rule) {
92 rules_.push_back(Entry(rule, name));
100 p.first->second->Add(name.substr(1), rule);
103 void Get(StringPiece name, vector<const Rule*>* rules) const {
107 rules->push_back(ent.rule);
137 // suffix rule.
146 vector<const Rule*> rules;
147 const Rule* primary_rule;
155 void AddRule(Symbol output, const Rule* r) {
187 const Rule* r,
202 void FillDepNodeLoc(const Rule* r, DepNode* n) const {
209 const Rule* pattern_rule,
222 for (const Rule* r : rules) {
250 const vector<const Rule*>& rules,
325 for (const Rule* r : p.second.rules) {
371 for (const Rule* r : found->second.rules) {
378 void PopulateRules(const vector<const Rule*>& rules) {
379 for (const Rule* rule : rules) {
380 if (rule->outputs.empty()) {
381 PopulateImplicitRule(rule);
383 PopulateExplicitRule(rule);
391 bool PopulateSuffixRule(const Rule* rule, Symbol output) {
400 shared_ptr<Rule> r = make_shared<Rule>(*rule);
408 void PopulateExplicitRule(const Rule* rule) {
409 for (Symbol output : rule->outputs) {
413 rules_[output].AddRule(output, rule);
414 PopulateSuffixRule(rule, output);
418 static bool IsIgnorableImplicitRule(const Rule* rule) {
421 if (rule->inputs.size() != 1)
423 if (!rule->order_only_inputs.empty())
425 if (!rule->cmds.empty())
427 const string& i = rule->inputs[0].str();
432 void PopulateImplicitRule(const Rule* rule) {
433 for (Symbol output_pattern : rule->output_patterns) {
434 if (output_pattern.str() != "%" || !IsIgnorableImplicitRule(rule))
435 implicit_rules_->Add(output_pattern.str(), rule);
454 bool CanPickImplicitRule(const Rule* rule, Symbol output, DepNode* n,
455 shared_ptr<Rule>* out_rule) {
457 for (Symbol output_pattern : rule->output_patterns) {
461 for (Symbol input : rule->inputs) {
479 *out_rule = make_shared<Rule>(*rule);
483 for (Symbol output_pattern : rule->output_patterns) {
514 shared_ptr<Rule>* pattern_rule,
523 vector<const Rule*> irules;
546 for (const shared_ptr<Rule> &irule : found->second) {
582 shared_ptr<Rule> pattern_rule;
657 typedef unordered_map<StringPiece, vector<shared_ptr<Rule>>> SuffixRuleMap;
669 const vector<const Rule*>& rules,