+static void
+cfi_add_CFA_insn(int insn)
+{
+ struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data ();
+
+ insn_ptr->insn = insn;
+}
+
+static void
+cfi_add_CFA_insn_reg (int insn, unsigned regno)
+{
+ struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data ();
+
+ insn_ptr->insn = insn;
+ insn_ptr->u.r = regno;
+}
+
+static void
+cfi_add_CFA_insn_offset (int insn, offsetT offset)
+{
+ struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data ();
+
+ insn_ptr->insn = insn;
+ insn_ptr->u.i = offset;
+}
+
+static void
+cfi_add_CFA_insn_reg_reg (int insn, unsigned reg1, unsigned reg2)
+{
+ struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data ();
+
+ insn_ptr->insn = insn;
+ insn_ptr->u.rr.reg1 = reg1;
+ insn_ptr->u.rr.reg2 = reg2;
+}
+
+static void
+cfi_add_CFA_insn_reg_offset (int insn, unsigned regno, offsetT offset)
+{
+ struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data ();
+
+ insn_ptr->insn = insn;
+ insn_ptr->u.ri.reg = regno;
+ insn_ptr->u.ri.offset = offset;
+}
+
+/* Add a CFI insn to advance the PC from the last address to LABEL. */
+
+void
+cfi_add_advance_loc (symbolS *label)
+{
+ struct cfi_insn_data *insn = alloc_cfi_insn_data ();
+
+ insn->insn = DW_CFA_advance_loc;
+ insn->u.ll.lab1 = frchain_now->frch_cfi_data->last_address;
+ insn->u.ll.lab2 = label;
+
+ frchain_now->frch_cfi_data->last_address = label;
+}
+
+/* Add a DW_CFA_offset record to the CFI data. */
+
+void
+cfi_add_CFA_offset (unsigned regno, offsetT offset)
+{
+ unsigned int abs_data_align;
+
+ gas_assert (DWARF2_CIE_DATA_ALIGNMENT != 0);
+ cfi_add_CFA_insn_reg_offset (DW_CFA_offset, regno, offset);
+
+ abs_data_align = (DWARF2_CIE_DATA_ALIGNMENT < 0
+ ? -DWARF2_CIE_DATA_ALIGNMENT : DWARF2_CIE_DATA_ALIGNMENT);
+ if (offset % abs_data_align)
+ as_bad (_("register save offset not a multiple of %u"), abs_data_align);
+}
+
+/* Add a DW_CFA_def_cfa record to the CFI data. */
+
+void
+cfi_add_CFA_def_cfa (unsigned regno, offsetT offset)
+{
+ cfi_add_CFA_insn_reg_offset (DW_CFA_def_cfa, regno, offset);
+ frchain_now->frch_cfi_data->cur_cfa_offset = offset;
+}
+
+/* Add a DW_CFA_register record to the CFI data. */
+
+void
+cfi_add_CFA_register (unsigned reg1, unsigned reg2)
+{
+ cfi_add_CFA_insn_reg_reg (DW_CFA_register, reg1, reg2);
+}
+
+/* Add a DW_CFA_def_cfa_register record to the CFI data. */
+
+void
+cfi_add_CFA_def_cfa_register (unsigned regno)
+{
+ cfi_add_CFA_insn_reg (DW_CFA_def_cfa_register, regno);
+}
+
+/* Add a DW_CFA_def_cfa_offset record to the CFI data. */
+
+void
+cfi_add_CFA_def_cfa_offset (offsetT offset)
+{
+ cfi_add_CFA_insn_offset (DW_CFA_def_cfa_offset, offset);
+ frchain_now->frch_cfi_data->cur_cfa_offset = offset;
+}