Work around an internal compiler error in MSVC.

For some reason MSVC ICEs when trying to index into a map using
a temporary object.  Work around this by separating out the call
into multiple lines.

Patch by Aidan Dodds
Differential Revision: http://reviews.llvm.org/D6702
Reviewed by: Zachary Turner, Greg Clayton

llvm-svn: 224443
This commit is contained in:
Zachary Turner 2014-12-17 18:02:36 +00:00
parent 0b9d3eefdb
commit ac94b5b14c
1 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,9 @@ namespace lldb_private {
// no support for things larger than a uint64_t (yet)
if (size > 8)
return;
m_fields[ConstString(name.c_str())] = FieldImpl{field_type,static_cast<size_t>(bit_offset/8),static_cast<size_t>(size)};
ConstString const_name = ConstString(name.c_str());
size_t byte_index = static_cast<size_t>(bit_offset / 8);
m_fields[const_name] = FieldImpl{field_type, byte_index, size};
}
size_t total_size = struct_type.GetByteSize();
lldb::DataBufferSP buffer_sp(new DataBufferHeap(total_size,0));