summaryrefslogtreecommitdiff
path: root/tools/gold
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-02-05 05:36:01 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-02-05 05:36:01 +0000
commit98245c7060a0a5399ca9e53f25541a5751ce4689 (patch)
treee07c3fde4a10af8e78e37f5dbdf9e227bbc665a5 /tools/gold
parentb0e341bca13cc4c729ba577cfcc6257bb1da0b33 (diff)
downloadllvm-98245c7060a0a5399ca9e53f25541a5751ce4689.tar.gz
llvm-98245c7060a0a5399ca9e53f25541a5751ce4689.tar.bz2
llvm-98245c7060a0a5399ca9e53f25541a5751ce4689.tar.xz
It's not obvious, but lto_module_create_from_memory doesn't need to use the
buffer after it creates the Module. Thus, we don't need to store this pointer in claimed_file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gold')
-rw-r--r--tools/gold/gold-plugin.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
index 6f579fe370..d41cd812bc 100644
--- a/tools/gold/gold-plugin.cpp
+++ b/tools/gold/gold-plugin.cpp
@@ -45,7 +45,6 @@ namespace {
struct claimed_file {
lto_module_t M;
void *handle;
- void *buf;
std::vector<ld_plugin_symbol> syms;
};
@@ -197,7 +196,6 @@ ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
cf.M = buf ? lto_module_create_from_memory(buf, file->filesize) :
lto_module_create(file->name);
- cf.buf = buf;
if (!cf.M) {
(*message)(LDPL_ERROR, "Failed to create LLVM module: %s",
lto_get_error_message());
@@ -334,10 +332,6 @@ ld_plugin_status all_symbols_read_hook(void) {
objFile->close();
lto_codegen_dispose(cg);
- for (std::list<claimed_file>::iterator I = Modules.begin(),
- E = Modules.end(); I != E; ++I) {
- free(I->buf);
- }
if ((*add_input_file)(const_cast<char*>(uniqueObjPath.c_str())) != LDPS_OK) {
(*message)(LDPL_ERROR, "Unable to add .o file to the link.");