| 82 | } |
| 83 | |
| 84 | int64_t |
| 85 | value::as_sconstant() const |
| 86 | { |
| 87 | cursor cur(cu->data(), offset); |
| 88 | switch (form) { |
| 89 | case DW_FORM::data1: |
| 90 | return cur.fixed<int8_t>(); |
| 91 | case DW_FORM::data2: |
| 92 | return cur.fixed<int16_t>(); |
| 93 | case DW_FORM::data4: |
| 94 | return cur.fixed<int32_t>(); |
| 95 | case DW_FORM::data8: |
| 96 | return cur.fixed<int64_t>(); |
| 97 | case DW_FORM::sdata: |
| 98 | return cur.sleb128(); |
| 99 | default: |
| 100 | throw value_type_mismatch("cannot read " + to_string(typ) + " as sconstant"); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | expr |
| 105 | value::as_exprloc() const |
no test coverage detected