Note *get_stmt_note(Stmt *stmt, char *name) { for (var i = 0; i < stmt->notes.num_notes; i++) { Note *note = stmt->notes.notes + i; if (note->name == name) { return(note); } } return(null); }
Note *get_decl_note(Decl *decl, char *name) { if (decl == null) { return(null); } for (int i = 0; i < decl->notes.num_notes; i++) { Note *note = decl->notes.notes + i; if (note->name == name) { return(note); } } return(null); }
Notes new_notes(Note *notes, int num_notes) { return(new Notes { notes = (Note *)notes, num_notes = num_notes }); }