[Materializer] Remove wrong SetSizeAndAlignmentFromType().

This function is unused.  It's also wrong, because it computes
the size and the alignment of the type without asking the runtime,
so it doesn't work for any language that has one (e.g. swift).

One could consider re-implementing this passing an execution scope
context, and modifying GetTypeBitAlign() to do the right thing,
but given there are no uses, it's not really useful.

llvm-svn: 368249
This commit is contained in:
Davide Italiano
2019-08-08 03:15:48 +00:00
parent 277583ec0a
commit e04c62bb23
2 changed files with 0 additions and 16 deletions

View File

@@ -115,8 +115,6 @@ public:
void SetOffset(uint32_t offset) { m_offset = offset; }
protected:
void SetSizeAndAlignmentFromType(CompilerType &type);
uint32_t m_alignment;
uint32_t m_size;
uint32_t m_offset;

View File

@@ -45,20 +45,6 @@ uint32_t Materializer::AddStructMember(Entity &entity) {
return ret;
}
void Materializer::Entity::SetSizeAndAlignmentFromType(CompilerType &type) {
if (llvm::Optional<uint64_t> size = type.GetByteSize(nullptr))
m_size = *size;
uint32_t bit_alignment = type.GetTypeBitAlign();
if (bit_alignment % 8) {
bit_alignment += 8;
bit_alignment &= ~((uint32_t)0x111u);
}
m_alignment = bit_alignment / 8;
}
class EntityPersistentVariable : public Materializer::Entity {
public:
EntityPersistentVariable(lldb::ExpressionVariableSP &persistent_variable_sp,