[PATCH] D15390: [ThinLTO] Launch importing backends in parallel threads from gold plugin
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 17 11:16:26 PST 2015
tejohnson added inline comments.
================
Comment at: tools/gold/gold-plugin.cpp:81
@@ -77,3 +80,3 @@
struct PluginInputFile {
- void *handle;
- ld_plugin_input_file File;
+ void *Handle;
+ std::unique_ptr<ld_plugin_input_file> File;
----------------
rafael wrote:
> Please rebase the patch.
Will do and upload the new one shortly.
================
Comment at: tools/gold/gold-plugin.cpp:82
@@ +81,3 @@
+ void *Handle;
+ std::unique_ptr<ld_plugin_input_file> File;
+ bool Valid;
----------------
rafael wrote:
> You can just memcpy the ld_plugin_input_file, no ?
I could and I considered that. As currently defined by gold it would save to memcpy. However, I thought it would be better to use a unique_ptr since it doesn't assume anything about the structure which isn't defined here, and it seemed clearer and cleaner to avoid copying. Note we pass a reference to this member to the ThreadPool::async to be used by the thread, that would have to be changed to a memcpy as well.
http://reviews.llvm.org/D15390
More information about the llvm-commits
mailing list