MCPcopy Create free account
hub / github.com/aclements/libelfin / as_sconstant

Method as_sconstant

dwarf/value.cc:84–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84int64_t
85value::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
104expr
105value::as_exprloc() const

Callers 1

to_stringFunction · 0.80

Calls 3

value_type_mismatchClass · 0.85
to_stringFunction · 0.85
sleb128Method · 0.80

Tested by

no test coverage detected