Lines Matching refs:r
42 string r; in ReplaceSuffix() local
43 AppendString(StripExt(s.str()), &r); in ReplaceSuffix()
44 r += '.'; in ReplaceSuffix()
45 AppendString(newsuf.str(), &r); in ReplaceSuffix()
46 return Intern(r); in ReplaceSuffix()
49 void ApplyOutputPattern(const Rule& r, in ApplyOutputPattern() argument
55 if (r.is_suffix_rule) { in ApplyOutputPattern()
61 if (r.output_patterns.empty()) { in ApplyOutputPattern()
65 CHECK(r.output_patterns.size() == 1); in ApplyOutputPattern()
66 Pattern pat(r.output_patterns[0].str()); in ApplyOutputPattern()
76 Entry(const Rule* r, StringPiece s) : rule(r), suffix(s) {} in Entry()
117 size_t r = rules_.size(); in size() local
119 r += c.second->size(); in size()
120 return r; in size()
178 void AddRule(Symbol output, const Rule* r) { in AddRule()
180 is_double_colon = r->is_double_colon; in AddRule()
181 } else if (is_double_colon != r->is_double_colon) { in AddRule()
182 ERROR_LOC(r->loc, "*** target file `%s' has both : and :: entries.", in AddRule()
186 if (primary_rule && !r->cmds.empty() && !IsSuffixRule(output) && in AddRule()
187 !r->is_double_colon) { in AddRule()
189 ERROR_LOC(r->cmd_loc(), in AddRule()
194 WARN_LOC(r->cmd_loc(), "warning: overriding commands for target `%s'", in AddRule()
200 primary_rule = r; in AddRule()
202 if (!primary_rule && !r->cmds.empty()) { in AddRule()
203 primary_rule = r; in AddRule()
206 rules.push_back(r); in AddRule()
209 void FillDepNodeFromRule(Symbol output, const Rule* r, DepNode* n) const { in FillDepNodeFromRule()
211 copy(r->cmds.begin(), r->cmds.end(), back_inserter(n->cmds)); in FillDepNodeFromRule()
213 ApplyOutputPattern(*r, output, r->inputs, &n->actual_inputs); in FillDepNodeFromRule()
214 ApplyOutputPattern(*r, output, r->order_only_inputs, in FillDepNodeFromRule()
217 if (r->output_patterns.size() >= 1) { in FillDepNodeFromRule()
218 CHECK(r->output_patterns.size() == 1); in FillDepNodeFromRule()
219 n->output_pattern = r->output_patterns[0]; in FillDepNodeFromRule()
223 void FillDepNodeLoc(const Rule* r, DepNode* n) const { in FillDepNodeLoc()
224 n->loc = r->loc; in FillDepNodeLoc()
225 if (!r->cmds.empty() && r->cmd_lineno) in FillDepNodeLoc()
226 n->loc.lineno = r->cmd_lineno; in FillDepNodeLoc()
241 for (const Rule* r : rules) { in FillDepNode() local
242 if (r == primary_rule) in FillDepNode()
244 FillDepNodeFromRule(output, r, n); in FillDepNode()
246 n->loc = r->loc; in FillDepNode()
251 for (const Rule* r : implicit_output.second->rules) { in FillDepNode() local
252 FillDepNodeFromRule(output, r, n); in FillDepNode()
260 DepNode::DepNode(Symbol o, bool p, bool r) in DepNode() argument
265 is_restat(r), in DepNode()
349 for (const Rule* r : p.second.rules) { in Build() local
350 for (Symbol t : r->inputs) in Build()
352 for (Symbol t : r->order_only_inputs) in Build()
391 for (const Rule* r : found->second.rules) { in GetRuleInputs() local
392 for (Symbol i : r->inputs) in GetRuleInputs()
446 shared_ptr<Rule> r = make_shared<Rule>(*rule); in PopulateSuffixRule() local
447 r->inputs.clear(); in PopulateSuffixRule()
448 r->inputs.push_back(Intern(input_suffix)); in PopulateSuffixRule()
449 r->is_suffix_rule = true; in PopulateSuffixRule()
450 suffix_rules_[output_suffix].push_back(r); in PopulateSuffixRule()
561 Vars* r = new Vars(*found->second); in MergeImplicitRuleVars() local
563 (*r)[p.first] = p.second; in MergeImplicitRuleVars()
565 return r; in MergeImplicitRuleVars()