mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 14:50:26 +00:00
Fix five of the shared library build targets
Before this patch there was a cyclic dependency between lldCore and lldReaderWriter. Only lldConfig could be built as a shared library. * Moved Reader and Writer base classes into lldCore. * The following shared libraries can now be built: lldCore lldYAML lldNative lldPasses lldReaderWriter Differential Revision: http://reviews.llvm.org/D7105 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226732
This commit is contained in:
parent
e24b8a03b9
commit
4b6a7e355b
@ -10,8 +10,8 @@ The purpose of a "Reader" is to take an object file in a particular format
|
||||
and create an `lld::File`:cpp:class: (which is a graph of Atoms)
|
||||
representing the object file. A Reader inherits from
|
||||
`lld::Reader`:cpp:class: which lives in
|
||||
:file:`include/lld/ReaderWriter/Reader.h` and
|
||||
:file:`lib/ReaderWriter/Reader.cpp`.
|
||||
:file:`include/lld/Core/Reader.h` and
|
||||
:file:`lib/Core/Reader.cpp`.
|
||||
|
||||
The Reader infrastructure for an object format ``Foo`` requires the
|
||||
following pieces in order to fit into lld:
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "lld/Core/Parallel.h"
|
||||
#include "lld/Core/Reference.h"
|
||||
#include "lld/Core/range.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "llvm/Support/ErrorOr.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <string>
|
||||
|
@ -1,4 +1,4 @@
|
||||
//===- lld/ReaderWriter/Reader.h - Abstract File Format Reading Interface -===//
|
||||
//===- lld/Core/Reader.h - Abstract File Format Reading Interface ---------===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
@ -7,8 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLD_READER_WRITER_READER_H
|
||||
#define LLD_READER_WRITER_READER_H
|
||||
#ifndef LLD_CORE_READER_H
|
||||
#define LLD_CORE_READER_H
|
||||
|
||||
#include "lld/Core/LLVM.h"
|
||||
#include "lld/Core/Reference.h"
|
@ -1,4 +1,4 @@
|
||||
//===- lld/ReaderWriter/Writer.h - Abstract File Format Interface ---------===//
|
||||
//===- lld/Core/Writer.h - Abstract File Format Interface -----------------===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
@ -7,8 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLD_READER_WRITER_WRITER_H
|
||||
#define LLD_READER_WRITER_WRITER_H
|
||||
#ifndef LLD_CORE_WRITER_H
|
||||
#define LLD_CORE_WRITER_H
|
||||
|
||||
#include "lld/Core/LLVM.h"
|
||||
#include <memory>
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/Pass.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
@ -11,8 +11,8 @@
|
||||
#define LLD_READER_WRITER_CORE_LINKER_CONTEXT_H
|
||||
|
||||
#include "lld/Core/LinkingContext.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
||||
namespace lld {
|
||||
|
@ -15,8 +15,8 @@
|
||||
#include "lld/Core/PassManager.h"
|
||||
#include "lld/Core/STDExtras.h"
|
||||
#include "lld/Core/range.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/StringSet.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/Object/ELF.h"
|
||||
|
@ -11,8 +11,8 @@
|
||||
#define LLD_READER_WRITER_MACHO_LINKING_CONTEXT_H
|
||||
|
||||
#include "lld/Core/LinkingContext.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/StringSet.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
@ -11,8 +11,8 @@
|
||||
#define LLD_READER_WRITER_PECOFF_LINKING_CONTEXT_H
|
||||
|
||||
#include "lld/Core/LinkingContext.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/Support/Allocator.h"
|
||||
#include "llvm/Support/COFF.h"
|
||||
|
@ -3,8 +3,10 @@ add_llvm_library(lldCore
|
||||
Error.cpp
|
||||
File.cpp
|
||||
LinkingContext.cpp
|
||||
Reader.cpp
|
||||
Resolver.cpp
|
||||
SymbolTable.cpp
|
||||
Writer.cpp
|
||||
LINK_LIBS
|
||||
LLVMSupport
|
||||
)
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "lld/Core/LinkingContext.h"
|
||||
#include "lld/Core/Resolver.h"
|
||||
#include "lld/Core/Simple.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/Support/Process.h"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//===- lib/ReaderWriter/Reader.cpp ----------------------------------------===//
|
||||
//===- lib/Core/Reader.cpp ------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
@ -8,7 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Support/Errc.h"
|
||||
#include "llvm/Support/FileUtilities.h"
|
@ -1,4 +1,4 @@
|
||||
//===- lib/ReaderWriter/Writer.cpp ----------------------------------------===//
|
||||
//===- lib/Core/Writer.cpp ------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Linker
|
||||
//
|
||||
@ -8,7 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
|
||||
namespace lld {
|
||||
Writer::Writer() {
|
@ -7,9 +7,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Driver/Driver.h"
|
||||
#include "lld/ReaderWriter/CoreLinkingContext.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
|
@ -13,12 +13,12 @@
|
||||
#include "lld/Core/LLVM.h"
|
||||
#include "lld/Core/Parallel.h"
|
||||
#include "lld/Core/PassManager.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Resolver.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/Driver/Driver.h"
|
||||
#include "lld/Passes/RoundTripNativePass.h"
|
||||
#include "lld/Passes/RoundTripYAMLPass.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
#include "llvm/Option/Arg.h"
|
||||
|
@ -3,6 +3,8 @@ add_llvm_library(lldPasses
|
||||
RoundTripNativePass.cpp
|
||||
RoundTripYAMLPass.cpp
|
||||
LINK_LIBS
|
||||
lldReaderWriter
|
||||
lldCore
|
||||
lldNative
|
||||
lldYAML
|
||||
LLVMSupport
|
||||
)
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
#include "lld/Core/Instrumentation.h"
|
||||
#include "lld/Core/Simple.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/Passes/RoundTripNativePass.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include <memory>
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
#include "lld/Core/Instrumentation.h"
|
||||
#include "lld/Core/Simple.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/Passes/RoundTripYAMLPass.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include <memory>
|
||||
|
@ -12,11 +12,10 @@ add_llvm_library(lldReaderWriter
|
||||
CoreLinkingContext.cpp
|
||||
FileArchive.cpp
|
||||
LinkerScript.cpp
|
||||
Reader.cpp
|
||||
Writer.cpp
|
||||
FileArchive.cpp
|
||||
LINK_LIBS
|
||||
lldCore
|
||||
lldPasses
|
||||
lldYAML
|
||||
LLVMObject
|
||||
LLVMSupport
|
||||
)
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "CreateELF.h"
|
||||
#include "DynamicFile.h"
|
||||
#include "ELFFile.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
|
||||
namespace lld {
|
||||
namespace elf {
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "lld/Core/Parallel.h"
|
||||
#include "lld/Core/SharedLibraryFile.h"
|
||||
#include "lld/ReaderWriter/ELFLinkingContext.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/StringSet.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "SectionChunks.h"
|
||||
#include "Writer.h"
|
||||
#include "lld/Core/range.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Object/ELF.h"
|
||||
|
@ -7,7 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "DynamicLibraryWriter.h"
|
||||
#include "ExecutableWriter.h"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#define LLD_READER_WRITER_ELF_WRITER_H
|
||||
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
|
||||
namespace lld {
|
||||
namespace elf {
|
||||
|
@ -14,11 +14,11 @@
|
||||
#include "MachOPasses.h"
|
||||
#include "lld/Core/ArchiveLibraryFile.h"
|
||||
#include "lld/Core/PassManager.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/Driver/Driver.h"
|
||||
#include "lld/Passes/LayoutPass.h"
|
||||
#include "lld/Passes/RoundTripYAMLPass.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/Config/config.h"
|
||||
|
@ -7,10 +7,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "ExecutableAtoms.hpp"
|
||||
#include "MachONormalizedFile.h"
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/ReaderWriter/MachOLinkingContext.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
@ -2,6 +2,6 @@ add_llvm_library(lldNative
|
||||
ReaderNative.cpp
|
||||
WriterNative.cpp
|
||||
LINK_LIBS
|
||||
lldReaderWriter
|
||||
lldCore
|
||||
LLVMSupport
|
||||
)
|
||||
|
@ -9,6 +9,6 @@
|
||||
|
||||
LLD_LEVEL := ../../..
|
||||
LIBRARYNAME := lldNative
|
||||
USEDLIBS = lldReaderWriter.a lldCore.a
|
||||
USEDLIBS = lldCore.a
|
||||
|
||||
include $(LLD_LEVEL)/Makefile
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "lld/Core/Atom.h"
|
||||
#include "lld/Core/Error.h"
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Simple.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
|
@ -7,10 +7,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "NativeFileFormat.h"
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/LinkingContext.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
@ -16,13 +16,13 @@
|
||||
#include "LoadConfigPass.h"
|
||||
#include "PDBPass.h"
|
||||
#include "lld/Core/PassManager.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Simple.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/Passes/LayoutPass.h"
|
||||
#include "lld/Passes/RoundTripNativePass.h"
|
||||
#include "lld/Passes/RoundTripYAMLPass.h"
|
||||
#include "lld/ReaderWriter/PECOFFLinkingContext.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/Support/Allocator.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
|
@ -10,9 +10,9 @@
|
||||
#include "Atoms.h"
|
||||
#include "lld/Core/Alias.h"
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Driver/Driver.h"
|
||||
#include "lld/ReaderWriter/PECOFFLinkingContext.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Object/COFF.h"
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "WriterImportLibrary.h"
|
||||
#include "lld/Core/DefinedAtom.h"
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/ReaderWriter/AtomLayout.h"
|
||||
#include "lld/ReaderWriter/PECOFFLinkingContext.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/Object/COFF.h"
|
||||
#include "llvm/Support/COFF.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
add_llvm_library(lldYAML
|
||||
ReaderWriterYAML.cpp
|
||||
LINK_LIBS
|
||||
lldReaderWriter
|
||||
lldCore
|
||||
LLVMSupport
|
||||
)
|
||||
|
@ -9,6 +9,6 @@
|
||||
|
||||
LLD_LEVEL := ../../..
|
||||
LIBRARYNAME := lldYAML
|
||||
USEDLIBS = lldReaderWriter.a lldCore.a
|
||||
USEDLIBS = lldCore.a
|
||||
|
||||
include $(LLD_LEVEL)/Makefile
|
||||
|
@ -12,10 +12,10 @@
|
||||
#include "lld/Core/Error.h"
|
||||
#include "lld/Core/File.h"
|
||||
#include "lld/Core/LLVM.h"
|
||||
#include "lld/Core/Reader.h"
|
||||
#include "lld/Core/Reference.h"
|
||||
#include "lld/Core/Simple.h"
|
||||
#include "lld/ReaderWriter/Reader.h"
|
||||
#include "lld/ReaderWriter/Writer.h"
|
||||
#include "lld/Core/Writer.h"
|
||||
#include "lld/ReaderWriter/YamlContext.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
|
Loading…
Reference in New Issue
Block a user