[Lldb-commits] [lldb] r282659 - Re-commit the changes from r282565 that I had to back out because of

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 28 18:13:47 PDT 2016


On Wed, Sep 28, 2016 at 6:09 PM Jason Molenda via lldb-commits <
lldb-commits at lists.llvm.org> wrote:

>
> +#include "x86AssemblyInspectionEngine.h"
> +
> +#include "llvm-c/Disassembler.h"
> +
> +#include "lldb/Core/Address.h"
> +#include "lldb/Symbol/UnwindPlan.h"
> +#include "lldb/Target/RegisterContext.h"
> +#include "lldb/Target/UnwindAssembly.h"
> +
> +using namespace lldb_private;
> +using namespace lldb;
> +
> +x86AssemblyInspectionEngine::x86AssemblyInspectionEngine(const ArchSpec
> &arch)
> +    : m_cur_insn(nullptr), m_machine_ip_regnum(LLDB_INVALID_REGNUM),
> +      m_machine_sp_regnum(LLDB_INVALID_REGNUM),
> +      m_machine_fp_regnum(LLDB_INVALID_REGNUM),
> +      m_lldb_ip_regnum(LLDB_INVALID_REGNUM),
> +      m_lldb_sp_regnum(LLDB_INVALID_REGNUM),
> +      m_lldb_fp_regnum(LLDB_INVALID_REGNUM),
>
+
> +      m_reg_map(), m_arch(arch), m_cpu(k_cpu_unspecified), m_wordsize(-1),
> +      m_register_map_initialized(false), m_disasm_context() {
>
You may or may not wish to take advantage of this, but since C++11 you can
initialize class members in the header file.  So you could write:

uint32_t m_lldb_fp_regnum = LLDB_INVALID_REGNUM;

etc.  This makes the constructors look a lot nicer, especially when you
have multiple overloads that all end up doing the same ugly initialization.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160929/41dadf12/attachment.html>


More information about the lldb-commits mailing list