| 777 | } |
| 778 | |
| 779 | string OpInfo::GetConstructorDecl(StringPiece op_name_prefix, |
| 780 | bool include_attr) const { |
| 781 | const string prefix = strings::StrCat(op_name_prefix, op_name, "("); |
| 782 | string c_decl; |
| 783 | for (int i = 0; i < arg_types.size(); ++i) { |
| 784 | if (i > 0) strings::StrAppend(&c_decl, ", "); |
| 785 | strings::StrAppend(&c_decl, arg_types[i], " ", arg_names[i]); |
| 786 | } |
| 787 | if (include_attr && has_optional_attrs) { |
| 788 | strings::StrAppend(&c_decl, ", const ", op_name, "::Attrs& attrs"); |
| 789 | } |
| 790 | strings::StrAppend(&c_decl, ")"); |
| 791 | return WordWrap(prefix, c_decl, kRightMargin); |
| 792 | } |
| 793 | |
| 794 | void OpInfo::WriteClassDecl(WritableFile* h) const { |
| 795 | string class_decl = comment; |