mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
[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:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user