Lines Matching refs:Rule
855 // A DWARF rule for recovering the address or value of a register, or
857 // each '*Rule' member function in CallFrameInfo::Handler.
869 class CallFrameInfo::Rule {
871 virtual ~Rule() { }
874 // recovered using this rule. If REGISTER is kCFARegister, then this rule
882 virtual bool operator==(const Rule &rhs) const = 0;
884 bool operator!=(const Rule &rhs) const { return ! (*this == rhs); }
886 // Return a pointer to a copy of this rule.
887 virtual Rule *Copy() const = 0;
889 // If this is a base+offset rule, change its base register to REG.
893 // If this is a base+offset rule, change its offset to OFFSET. Otherwise,
898 // Rule: the value the register had in the caller cannot be recovered.
899 class CallFrameInfo::UndefinedRule: public CallFrameInfo::Rule {
906 bool operator==(const Rule &rhs) const {
912 Rule *Copy() const { return new UndefinedRule(*this); }
915 // Rule: the register's value is the same as that it had in the caller.
916 class CallFrameInfo::SameValueRule: public CallFrameInfo::Rule {
923 bool operator==(const Rule &rhs) const {
929 Rule *Copy() const { return new SameValueRule(*this); }
932 // Rule: the register is saved at OFFSET from BASE_REGISTER. BASE_REGISTER
934 class CallFrameInfo::OffsetRule: public CallFrameInfo::Rule {
942 bool operator==(const Rule &rhs) const {
950 Rule *Copy() const { return new OffsetRule(*this); }
960 // Rule: the value the register had in the caller is the value of
963 class CallFrameInfo::ValOffsetRule: public CallFrameInfo::Rule {
971 bool operator==(const Rule &rhs) const {
979 Rule *Copy() const { return new ValOffsetRule(*this); }
987 // Rule: the register has been saved in another register REGISTER_NUMBER_.
988 class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule {
996 bool operator==(const Rule &rhs) const {
1002 Rule *Copy() const { return new RegisterRule(*this); }
1007 // Rule: EXPRESSION evaluates to the address at which the register is saved.
1008 class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
1016 bool operator==(const Rule &rhs) const {
1022 Rule *Copy() const { return new ExpressionRule(*this); }
1027 // Rule: EXPRESSION evaluates to the address at which the register is saved.
1028 class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
1036 bool operator==(const Rule &rhs) const {
1043 Rule *Copy() const { return new ValExpressionRule(*this); }
1057 // Set the rule for computing the CFA to RULE. Take ownership of RULE.
1058 void SetCFARule(Rule *rule) { delete cfa_rule_; cfa_rule_ = rule; }
1060 // Return the current CFA rule. Unlike RegisterRule, this RuleMap retains
1061 // ownership of the rule. We use this for DW_CFA_def_cfa_offset and
1063 // a rule for it has been established.
1064 Rule *CFARule() const { return cfa_rule_; }
1066 // Return the rule for REG, or NULL if there is none. The caller takes
1068 Rule *RegisterRule(int reg) const;
1070 // Set the rule for computing REG to RULE. Take ownership of RULE.
1071 void SetRegisterRule(int reg, Rule *rule);
1082 typedef std::map<int, Rule *> RuleByNumber;
1087 // The rule for computing the canonical frame address. This RuleMap owns
1088 // this rule.
1089 Rule *cfa_rule_;
1106 CallFrameInfo::Rule *CallFrameInfo::RuleMap::RegisterRule(int reg) const {
1115 void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule *rule) {
1117 assert(rule);
1118 Rule **slot = ®isters_[reg];
1120 *slot = rule;
1134 // this RuleMap has a CFA rule but new_rules doesn't.
1169 // rule if it is different.
1182 // Since we only make transitions from a rule set to some previously
1183 // saved rule set, and we can only add rules to the map, NEW_RULES
1211 // Interpret instructions from CIE, save the resulting rule set for
1251 // STATE, report any rule changes to handler_, and return true. On
1259 // Set the CFA rule to be the value of BASE_REGISTER plus OFFSET, and
1264 // Change the offset of the CFA rule to OFFSET, and return true. On
1269 // Specify that REG can be recovered using RULE, and return true. On
1271 bool DoRule(unsigned reg, Rule *rule);
1283 // Restore REG to the rule established in the CIE, and return true. On
1454 // Restore the rule established for a register by the CIE.
1517 Rule *cfa_rule = rules_.CFARule();
1550 Rule *rule = new ValExpressionRule(ops.expression);
1551 rules_.SetCFARule(rule);
1552 if (!rule->Handle(handler_, address_,
1638 // Restore the rule established for a register by the CIE.
1709 Rule *rule = new ValOffsetRule(base_register, offset);
1710 rules_.SetCFARule(rule);
1711 return rule->Handle(handler_, address_,
1716 Rule *cfa_rule = rules_.CFARule();
1726 bool CallFrameInfo::State::DoRule(unsigned reg, Rule *rule) {
1727 rules_.SetRegisterRule(reg, rule);
1728 return rule->Handle(handler_, address_, reg);
1755 Rule *rule = cie_rules_.RegisterRule(reg);
1756 if (!rule) {
1761 rule = new SameValueRule();
1763 return DoRule(reg, rule);
2316 " the instruction at offset 0x%llx assumes that a CFA rule has"
2339 " would clear the CFA rule in effect\n",