[PATCH] D24493: Simplify InputFile ownership management.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 22:19:36 PDT 2016


ruiu created this revision.
ruiu added a reviewer: rafael.
ruiu added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

Previously, all input files were owned by the symbol table.
Files were created at various places, such as the Driver, the lazy
symbols, or the bitcode compiler, and the ownership of new files
was transferred to the symbol table using std::unique_ptr.
All input files were then free'd when the symbol table is freed
which is on program exit.

I think we don't have to transfer ownership just to free all
instance at once on exit.

In this patch, all instances are automatically collected to a
vector and freed on exit. In this way, we no longer have to
use std::unique_ptr.

https://reviews.llvm.org/D24493

Files:
  ELF/Driver.cpp
  ELF/Driver.h
  ELF/ICF.cpp
  ELF/InputFiles.cpp
  ELF/InputFiles.h
  ELF/LTO.cpp
  ELF/LTO.h
  ELF/LinkerScript.cpp
  ELF/MarkLive.cpp
  ELF/Mips.cpp
  ELF/OutputSections.cpp
  ELF/SymbolTable.cpp
  ELF/SymbolTable.h
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24493.71108.patch
Type: text/x-patch
Size: 22317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160913/939240ea/attachment.bin>


More information about the llvm-commits mailing list