@@ -197,13 +197,9 @@ void Scalar::GetValue(Stream *s, bool show_type) const {
197
197
}
198
198
}
199
199
200
- Scalar::Type Scalar::GetBestTypeForBitSize (size_t bit_size, bool sign) {
201
- return sign ? e_sint : e_uint;
202
- }
203
-
204
200
void Scalar::TruncOrExtendTo (uint16_t bits, bool sign) {
205
201
m_integer = sign ? m_integer.sextOrTrunc (bits) : m_integer.zextOrTrunc (bits);
206
- m_type = GetBestTypeForBitSize (bits, sign) ;
202
+ m_type = sign ? e_sint : e_uint ;
207
203
}
208
204
209
205
bool Scalar::IntegralPromote (uint16_t bits, bool sign) {
@@ -262,16 +258,6 @@ const char *Scalar::GetValueTypeAsCString(Scalar::Type type) {
262
258
return " ???" ;
263
259
}
264
260
265
- Scalar::Type
266
- Scalar::GetValueTypeForSignedIntegerWithByteSize (size_t byte_size) {
267
- return e_sint;
268
- }
269
-
270
- Scalar::Type
271
- Scalar::GetValueTypeForUnsignedIntegerWithByteSize (size_t byte_size) {
272
- return e_uint;
273
- }
274
-
275
261
bool Scalar::MakeSigned () {
276
262
bool success = false ;
277
263
@@ -768,12 +754,7 @@ Status Scalar::SetValueFromData(const DataExtractor &data,
768
754
case lldb::eEncodingSint: {
769
755
if (data.GetByteSize () < byte_size)
770
756
return Status (" insufficient data" );
771
- Type type = GetBestTypeForBitSize (byte_size*8 , encoding == lldb::eEncodingSint);
772
- if (type == e_void) {
773
- return Status (" unsupported integer byte size: %" PRIu64 " " ,
774
- static_cast <uint64_t >(byte_size));
775
- }
776
- m_type = type;
757
+ m_type = encoding == lldb::eEncodingSint ? e_sint : e_uint;
777
758
if (data.GetByteOrder () == endian::InlHostByteOrder ()) {
778
759
m_integer = APInt::getNullValue (8 * byte_size);
779
760
llvm::LoadIntFromMemory (m_integer, data.GetDataStart (), byte_size);
0 commit comments