[PATCH] Refactoring of Driver and TargetInfo

kledzik at apple.com kledzik at apple.com
Thu Mar 28 11:45:30 PDT 2013


Hi Bigcheese, shankarke,

This is my Driver refactoring patch.  The impetus of the changes were:
* Add support parsing darwin linker command line options.
* Clarify how in-process linking would be done vs command line linking

The major changes are:
1) LinkerOptions has been merged into TargetInfo
2) LinkerInvocation has been merged into Driver
3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it.  This is only how in-process linking would work.  That is, you can programmatically set up a TargetInfo object which controls the linking.
4) Lots of tweaks to test suite to work with driver changes
5) Add the DarwinDriver
6) I heavily doxygen commented TargetInfo.h

Things to do after this patch is committed:
a) Consider renaming TargetInfo, given its new roll.  
b) Consider pulling the list of input files out of TargetInfo.  This will enable in-process clients to create one TargetInfo the re-use it with different input file lists.
c) Work out a way for Drivers to format the warnings and error done in core linking.

http://llvm-reviews.chandlerc.com/D589

Files:
  test/error-fixup-target.objtxt
  test/absolute-local.objtxt
  test/section-position.objtxt
  test/tent-merge.objtxt
  test/ingroup-test-loop.objtxt
  test/dead-strip-basic.objtxt
  test/custom-section.objtxt
  test/undef-coalesce.objtxt
  test/pass-stubs-basic.objtxt
  test/error-fixup-attribute.objtxt
  test/ingroup-test-with-layout-after.objtxt
  test/shared-library-coalesce.objtxt
  test/error-atom-attribute.objtxt
  test/constants-coalesce.objtxt
  test/fixups-addend.objtxt
  test/auto-hide-coalesce.objtxt
  test/absolute-basic.objtxt
  test/empty.objtxt
  test/undef-weak-coalesce.objtxt
  test/CMakeLists.txt
  test/error-atom-type.objtxt
  test/error-file-attribute.objtxt
  test/error-atom-content-byte-value.objtxt
  test/archive-tentdef-search.objtxt
  test/darwin/hello-world.objtxt
  test/permissions.objtxt
  test/pass-got-basic.objtxt
  test/layoutafter-test.objtxt
  test/dead-strip-globals.objtxt
  test/layoutbefore-test.objtxt
  test/multiple-def-error.objtxt
  test/dead-strip-attributes.objtxt
  test/Driver/trivial-driver.test
  test/Driver/lib-search.test
  test/error-atom-content-bytes.objtxt
  test/cstring-coalesce.objtxt
  test/fixups-dup-named.objtxt
  test/shared-library-basic.objtxt
  test/inline-coalesce.objtxt
  test/elf/init_array.test
  test/elf/tls.test
  test/elf/ifunc.test
  test/elf/rodata.objtxt
  test/elf/check.objtxt
  test/elf/ppc.objtxt
  test/elf/gotpcrel.test
  test/elf/X86_64/multi-weak-syms-order.test
  test/elf/X86_64/weak-override.test
  test/elf/X86_64/multi-weak-override.test
  test/elf/X86_64/dynlib-nointerp-section.test
  test/elf/X86_64/weak-zero-sized.test
  test/elf/x86.objtxt
  test/elf/archive-elf.objtxt
  test/elf/hexagon-quickdata-sort.test
  test/elf/x86-64-dynamic-relocs.test
  test/elf/mergeconstants.objtxt
  test/elf/common.test
  test/elf/branch.objtxt
  test/elf/phdr.objtxt
  test/elf/hexagon-quickdata-sortcommon.test
  test/elf/entry.objtxt
  test/elf/reloc.objtxt
  test/elf/abs.objtxt
  test/elf/x86_64-kinds.test
  test/elf/quickdata.test
  test/elf/rodata.test
  test/elf/Hexagon/dynlib.test
  test/elf/Hexagon/dynlib-gotoff.test
  test/elf/Hexagon/hexagon-plt-setup.test
  test/elf/Hexagon/hexagon-got-plt-order.test
  test/elf/Hexagon/rela-order.test
  test/elf/Hexagon/sda-base.test
  test/elf/archive-elf-forceload.objtxt
  test/elf/sections.objtxt
  test/elf/symbols.objtxt
  test/elf/dynamic.test
  test/elf/mergeglobalatoms.test
  test/elf/dynamic-segorder.test
  test/elf/x86-64-dynamic.test
  test/elf/mergeatoms.objtxt
  test/error-atom-undefined-wrong-attribue.objtxt
  test/ingroup-test-big.objtxt
  test/fixups-named.objtxt
  test/archive-basic.objtxt
  test/ingroup-test.objtxt
  test/archive-chain.objtxt
  test/fixups-unnamed.objtxt
  test/weak-coalesce.objtxt
  test/undef-coalesce-error.objtxt
  tools/lld-core/lld-core.cpp
  tools/lld-core/CMakeLists.txt
  tools/lld/lld.cpp
  tools/CMakeLists.txt
  include/lld/ReaderWriter/ELFTargetInfo.h
  include/lld/ReaderWriter/Simple.h
  include/lld/ReaderWriter/MachOTargetInfo.h
  include/lld/ReaderWriter/CoreTargetInfo.h
  include/lld/ReaderWriter/ReaderLinkerScript.h
  include/lld/ReaderWriter/Reader.h
  include/lld/ReaderWriter/ReaderArchive.h
  include/lld/Core/LinkerOptions.h
  include/lld/Core/TargetInfo.h
  include/lld/Core/ArchiveLibraryFile.h
  include/lld/Driver/Driver.h
  include/lld/Driver/LinkerInvocation.h
  include/lld/Driver/LinkerInput.h
  lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
  lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
  lib/ReaderWriter/Reader.cpp
  lib/ReaderWriter/ReaderArchive.cpp
  lib/ReaderWriter/ELF/DefaultTargetHandler.h
  lib/ReaderWriter/ELF/PPC/PPCTargetInfo.cpp
  lib/ReaderWriter/ELF/PPC/PPCTargetInfo.h
  lib/ReaderWriter/ELF/Reader.cpp
  lib/ReaderWriter/ELF/X86/X86TargetInfo.cpp
  lib/ReaderWriter/ELF/X86/X86TargetInfo.h
  lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
  lib/ReaderWriter/ELF/Hexagon/HexagonTargetInfo.h
  lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h
  lib/ReaderWriter/ELF/Hexagon/HexagonTargetInfo.cpp
  lib/ReaderWriter/ELF/HeaderChunks.h
  lib/ReaderWriter/ELF/Writer.cpp
  lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp
  lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.h
  lib/ReaderWriter/ELF/Writer.h
  lib/ReaderWriter/ELF/ExecutableWriter.h
  lib/ReaderWriter/ELF/File.h
  lib/ReaderWriter/ELF/SectionChunks.h
  lib/ReaderWriter/ELF/DefaultLayout.h
  lib/ReaderWriter/ELF/Atoms.h
  lib/ReaderWriter/ELF/ELFTargetInfo.cpp
  lib/ReaderWriter/ELF/TargetHandler.h
  lib/ReaderWriter/ELF/OutputELFWriter.h
  lib/ReaderWriter/ELF/ExecutableAtoms.h
  lib/ReaderWriter/Native/ReaderNative.cpp
  lib/ReaderWriter/MachO/WriterMachO.cpp
  lib/ReaderWriter/MachO/MachOFormat.hpp
  lib/ReaderWriter/MachO/ReferenceKinds.cpp
  lib/ReaderWriter/MachO/ExecutableAtoms.hpp
  lib/ReaderWriter/MachO/MachOTargetInfo.cpp
  lib/ReaderWriter/MachO/ReferenceKinds.h
  lib/ReaderWriter/MachO/StubsPass.hpp
  lib/ReaderWriter/CoreTargetInfo.cpp
  lib/ReaderWriter/CMakeLists.txt
  lib/ReaderWriter/ReaderLinkerScript.cpp
  lib/Core/Resolver.cpp
  lib/Core/TargetInfo.cpp
  lib/Core/SymbolTable.cpp
  lib/Driver/Drivers.cpp
  lib/Driver/LinkerInvocation.cpp
  lib/Driver/LDOptions.td
  lib/Driver/DarwinLdDriver.cpp
  lib/Driver/CoreDriver.cpp
  lib/Driver/UniversalDriver.cpp
  lib/Driver/DarwinOptions.td
  lib/Driver/GnuLdDriver.cpp
  lib/Driver/CoreOptions.td
  lib/Driver/Driver.cpp
  lib/Driver/CMakeLists.txt
  lib/Passes/LayoutPass.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D589.1.patch
Type: text/x-patch
Size: 247913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130328/bfd2c038/attachment.bin>


More information about the llvm-commits mailing list