Rename Record::decl_id to id, Func::decl_id to record_decl_id.
The intention is to meke it clearer which items have a decl_id (record), and which items reference other items (func, mapped types).
While doing this I realized Func had a decl_id similarly to record, but I believe the intention was for methods to be able to reference their owning record (at least I think Devin is planning to rely on that AFAIK). So I fixed that. It is possible that in the future we will add Func::id field as well.
PiperOrigin-RevId: 413751180
diff --git a/rs_bindings_from_cc/ir.h b/rs_bindings_from_cc/ir.h
index a21367d..4bcf7f7 100644
--- a/rs_bindings_from_cc/ir.h
+++ b/rs_bindings_from_cc/ir.h
@@ -260,7 +260,9 @@
nlohmann::json ToJson() const;
UnqualifiedIdentifier name;
- DeclId decl_id;
+ // `DeclId` of the Record this function (method) belongs to, nullopt for
+ // free-standing functions.
+ std::optional<DeclId> record_decl_id = std::nullopt;
Label owning_target;
std::optional<std::string> doc_comment;
std::string mangled_name;
@@ -341,7 +343,7 @@
nlohmann::json ToJson() const;
Identifier identifier;
- DeclId decl_id;
+ DeclId id;
Label owning_target;
std::optional<std::string> doc_comment;
std::vector<Field> fields;