From ac94b5b14cea469d0a39f5258bb161448c248ca5 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 17 Dec 2014 18:02:36 +0000 Subject: [PATCH] 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 --- lldb/include/lldb/Utility/ProcessStructReader.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/include/lldb/Utility/ProcessStructReader.h b/lldb/include/lldb/Utility/ProcessStructReader.h index ea1b5ec..7e58091 100644 --- a/lldb/include/lldb/Utility/ProcessStructReader.h +++ b/lldb/include/lldb/Utility/ProcessStructReader.h @@ -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(bit_offset/8),static_cast(size)}; + ConstString const_name = ConstString(name.c_str()); + size_t byte_index = static_cast(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)); -- 2.7.4