vsk added inline comments.

================
Comment at: source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h:81
+  struct Guard {
+    DisassemblerLLVMC *m_instance;
+    Guard(DisassemblerLLVMC *instance, InstructionLLVMC *inst,
----------------
This is nice. Do you think it might be even safer to have the guard own the 
disassembler shared_ptr instance? Users could then access the disassembler via 
the guard's operator->, and there's less chance of the shared_ptr escaping / 
being abused. We could even have GetDisassembler() return a guard instance.


================
Comment at: source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h:85
+        : m_instance(instance) {
+      m_instance->Lock(inst, exe_ctx);
+    }
----------------
It doesn't make sense to me that DisassemblerLLVMC's "Lock" method conflates 
locking and initialization. If you decide to have a guard own the disassembler 
instance, it'd make sense to split the initialization step out.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51319



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to