sgraenitz added inline comments.

================
Comment at: source/Core/RichManglingContext.cpp:133
+  case PluginCxxLanguage:
+    m_cxx_method_str = ConstString(
+        
get<CPlusPlusLanguage::MethodName>(m_cxx_method_parser)->GetBasename());
----------------
labath wrote:
> I thought we were going to get rid of this ConstString? The C++ plugin is 
> able to provide the same (in fact, even stronger) lifetime guarantees as the 
> IPD, so we could just have a single method that always returns a StringRef. 
> (If you really want to, you can also have a ConstString-returning helper 
> function, but it could be implemented the same way as it is now for IPD, so 
> that both versions have the same runtime complexity.
> 
> I'd suggest having just a m_buffer StringRef object, which you set both here 
> and in processIPDStrResult. Then `GetBufferRef()` can just return that object 
> without any branching involved.
Yes, I can change the ConstString thing here.

> I'd suggest having just a m_buffer StringRef object
You mean a single buffer for both, IPD and C++ method parser plugin? Actually I 
don't like to mix that. In case of IPD the buffer is owned by the context. 
Otherwise it's owned by the C++ method parser plugin. I could manage that in 
`FromItaniumName` and `FromCxxMethodName`, but it will make everything more 
complicated. Top prio for me is to avoid reallocation of the relatively big 
initial `m_IPD_buf` and I think the cleanest way to do this is the RAII-style 
that's used already.


https://reviews.llvm.org/D50071



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

Reply via email to