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) {
181 const Rule* r,
196 void FillDepNodeLoc(const Rule* r, DepNode* n) const {
203 const Rule* pattern_rule,
216 for (const Rule* r : rules) {
244 const vector<const Rule*>& rules,
319 for (const Rule* r : p.second.rules) {
365 for (const Rule* r : found->second.rules) {
372 void PopulateRules(const vector<const Rule*>& rules) {
373 for (const Rule* rule : rules) {
374 if (rule->outputs.empty()) {
375 PopulateImplicitRule(rule);
377 PopulateExplicitRule(rule);
385 bool PopulateSuffixRule(const Rule* rule, Symbol output) {
394 shared_ptr<Rule> r = make_shared<Rule>(*rule);
402 void PopulateExplicitRule(const Rule* rule) {
403 for (Symbol output : rule->outputs) {
407 rules_[output].AddRule(output, rule);
408 PopulateSuffixRule(rule, output);
412 static bool IsIgnorableImplicitRule(const Rule* rule) {
415 if (rule->inputs.size() != 1)
417 if (!rule->order_only_inputs.empty())
419 if (!rule->cmds.empty())
421 const string& i = rule->inputs[0].str();
426 void PopulateImplicitRule(const Rule* rule) {
427 for (Symbol output_pattern : rule->output_patterns) {
428 if (output_pattern.str() != "%" || !IsIgnorableImplicitRule(rule))
429 implicit_rules_->Add(output_pattern.str(), rule);
448 bool CanPickImplicitRule(const Rule* rule, Symbol output, DepNode* n,
449 shared_ptr<Rule>* out_rule) {
451 for (Symbol output_pattern : rule->output_patterns) {
455 for (Symbol input : rule->inputs) {
473 *out_rule = make_shared<Rule>(*rule);
477 for (Symbol output_pattern : rule->output_patterns) {
508 shared_ptr<Rule>* pattern_rule,
517 vector<const Rule*> irules;
540 for (const shared_ptr<Rule> &irule : found->second) {
576 shared_ptr<Rule> pattern_rule;
651 typedef unordered_map<StringPiece, vector<shared_ptr<Rule>>> SuffixRuleMap;
663 const vector<const Rule*>& rules,