Skip to content

Commit

Permalink
Move new lld's code to Common subdirectory.
Browse files Browse the repository at this point in the history
New lld's files are spread under lib subdirectory, and it isn't easy
to find which files are actually maintained. This patch moves maintained
files to Common subdirectory.

Differential Revision: https://reviews.llvm.org/D37645

llvm-svn: 314719
  • Loading branch information
rui314 committed Oct 2, 2017
1 parent e2ff2ba commit 3f85170
Show file tree
Hide file tree
Showing 71 changed files with 94 additions and 91 deletions.
5 changes: 3 additions & 2 deletions lld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ endif ()

# Configure the Version.inc file.
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/lld/Config/Version.inc.in
${CMAKE_CURRENT_BINARY_DIR}/include/lld/Config/Version.inc)
${CMAKE_CURRENT_SOURCE_DIR}/include/lld/Common/Version.inc.in
${CMAKE_CURRENT_BINARY_DIR}/include/lld/Common/Version.inc)


if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
Expand Down Expand Up @@ -210,6 +210,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
)
endif()

add_subdirectory(Common)
add_subdirectory(lib)
add_subdirectory(tools/lld)

Expand Down
1 change: 1 addition & 0 deletions lld/COFF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ add_lld_library(lldCOFF
WindowsManifest

LINK_LIBS
lldCommon
lldCore
${LLVM_PTHREAD_LIB}

Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/Chunks.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "Config.h"
#include "InputFiles.h"
#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "SymbolTable.h"
#include "Symbols.h"
#include "Writer.h"
#include "lld/Driver/Driver.h"
#include "lld/Common/Driver.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Magic.h"
Expand Down
4 changes: 2 additions & 2 deletions lld/COFF/Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#include "Config.h"
#include "SymbolTable.h"
#include "lld/Core/LLVM.h"
#include "lld/Core/Reproduce.h"
#include "lld/Common/LLVM.h"
#include "lld/Common/Reproduce.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Object/Archive.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_COFF_ERROR_H
#define LLD_COFF_ERROR_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/Support/Error.h"

namespace lld {
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/InputFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define LLD_COFF_INPUT_FILES_H

#include "Config.h"
#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/LTO/LTO.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/LTO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Error.h"
#include "InputFiles.h"
#include "Symbols.h"
#include "lld/Core/TargetOptionsCommandFlags.h"
#include "lld/Common/TargetOptionsCommandFlags.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/LTO.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef LLD_COFF_LTO_H
#define LLD_COFF_LTO_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/SmallString.h"
#include <memory>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion lld/COFF/Symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Chunks.h"
#include "Config.h"
#include "Memory.h"
#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/COFF.h"
Expand Down
12 changes: 12 additions & 0 deletions lld/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
add_lld_library(lldCommon
Reproduce.cpp
TargetOptionsCommandFlags.cpp
Version.cpp

ADDITIONAL_HEADER_DIRS
${LLD_INCLUDE_DIR}/lld/Common

LINK_COMPONENTS
Option
Support
)
2 changes: 1 addition & 1 deletion lld/lib/Core/Reproduce.cpp → lld/Common/Reproduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//

#include "lld/Core/Reproduce.h"
#include "lld/Common/Reproduce.h"
#include "llvm/Option/Arg.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
//===----------------------------------------------------------------------===//

#include "lld/Core/TargetOptionsCommandFlags.h"
#include "lld/Common/TargetOptionsCommandFlags.h"

#include "llvm/CodeGen/CommandFlags.h"
#include "llvm/Target/TargetOptions.h"
Expand Down
4 changes: 2 additions & 2 deletions lld/lib/Config/Version.cpp → lld/Common/Version.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- lib/Config/Version.cpp - LLD Version Number ---------------*- C++-=====//
//===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//

#include "lld/Config/Version.h"
#include "lld/Common/Version.h"

using namespace llvm;

Expand Down
1 change: 1 addition & 0 deletions lld/ELF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ add_lld_library(lldELF
TransformUtils

LINK_LIBS
lldCommon
lldConfig
lldCore
${LLVM_PTHREAD_LIB}
Expand Down
4 changes: 2 additions & 2 deletions lld/ELF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
#include "Target.h"
#include "Threads.h"
#include "Writer.h"
#include "lld/Config/Version.h"
#include "lld/Driver/Driver.h"
#include "lld/Common/Driver.h"
#include "lld/Common/Version.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/CommandLine.h"
Expand Down
4 changes: 2 additions & 2 deletions lld/ELF/Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#define LLD_ELF_DRIVER_H

#include "SymbolTable.h"
#include "lld/Core/LLVM.h"
#include "lld/Core/Reproduce.h"
#include "lld/Common/LLVM.h"
#include "lld/Common/Reproduce.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
Expand Down
4 changes: 2 additions & 2 deletions lld/ELF/DriverUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include "Driver.h"
#include "Error.h"
#include "Memory.h"
#include "lld/Config/Version.h"
#include "lld/Core/Reproduce.h"
#include "lld/Common/Reproduce.h"
#include "lld/Common/Version.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Triple.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/EhFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_ELF_EHFRAME_H
#define LLD_ELF_EHFRAME_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"

namespace lld {
namespace elf {
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef LLD_ELF_ERROR_H
#define LLD_ELF_ERROR_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"

#include "llvm/Support/Error.h"

Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/Filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_ELF_FILESYSTEM_H
#define LLD_ELF_FILESYSTEM_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"

namespace lld {
namespace elf {
Expand Down
4 changes: 2 additions & 2 deletions lld/ELF/InputFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "InputSection.h"
#include "Symbols.h"

#include "lld/Core/LLVM.h"
#include "lld/Core/Reproduce.h"
#include "lld/Common/LLVM.h"
#include "lld/Common/Reproduce.h"
#include "llvm/ADT/CachedHashString.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/InputSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Config.h"
#include "Relocations.h"
#include "Thunks.h"
#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/CachedHashString.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/TinyPtrVector.h"
Expand Down
4 changes: 2 additions & 2 deletions lld/ELF/LTO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "LTO.h"
#include "Config.h"
#include "Error.h"
#include "LinkerScript.h"
#include "InputFiles.h"
#include "LinkerScript.h"
#include "SymbolTable.h"
#include "Symbols.h"
#include "lld/Core/TargetOptionsCommandFlags.h"
#include "lld/Common/TargetOptionsCommandFlags.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/LTO.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef LLD_ELF_LTO_H
#define LLD_ELF_LTO_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/LinkerScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Config.h"
#include "Strings.h"
#include "Writer.h"
#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/OutputSections.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "LinkerScript.h"
#include "Relocations.h"

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/MC/StringTableBuilder.h"
#include "llvm/Object/ELF.h"

Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/Relocations.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_ELF_RELOCATIONS_H
#define LLD_ELF_RELOCATIONS_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/DenseMap.h"
#include <map>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/ScriptLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_ELF_SCRIPT_LEXER_H
#define LLD_ELF_SCRIPT_LEXER_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MemoryBuffer.h"
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/ScriptParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_ELF_SCRIPT_PARSER_H
#define LLD_ELF_SCRIPT_PARSER_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/Support/MemoryBuffer.h"

namespace lld {
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/Strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef LLD_ELF_STRINGS_H
#define LLD_ELF_STRINGS_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/Optional.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/Symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "InputSection.h"
#include "Strings.h"

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/ELF.h"

Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/SyntheticSections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "Target.h"
#include "Threads.h"
#include "Writer.h"
#include "lld/Config/Version.h"
#include "lld/Common/Version.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugPubTable.h"
#include "llvm/Object/Decompressor.h"
Expand Down
2 changes: 1 addition & 1 deletion lld/docs/Driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Adding an Option to an existing Flavor
Adding a Flavor
===============

#. Add an entry for the flavor in :file:`include/lld/Driver/Driver.h` to
#. Add an entry for the flavor in :file:`include/lld/Common/Driver.h` to
:cpp:class:`lld::UniversalDriver::Flavor`.

#. Add an entry in :file:`lib/Driver/UniversalDriver.cpp` to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- lld/Driver/Driver.h - Linker Driver Emulator -----------------------===//
//===- lld/Common/Driver.h - Linker Driver Emulator -----------------------===//
//
// The LLVM Linker
//
Expand All @@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLD_DRIVER_DRIVER_H
#define LLD_DRIVER_DRIVER_H
#ifndef LLD_COMMON_DRIVER_H
#define LLD_COMMON_DRIVER_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/raw_ostream.h"
Expand Down
4 changes: 2 additions & 2 deletions lld/include/lld/Core/LLVM.h → lld/include/lld/Common/LLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLD_CORE_LLVM_H
#define LLD_CORE_LLVM_H
#ifndef LLD_COMMON_LLVM_H
#define LLD_COMMON_LLVM_H

// This should be the only #include, force #includes of all the others on
// clients.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLD_CORE_REPRODUCE_H
#define LLD_CORE_REPRODUCE_H
#ifndef LLD_COMMON_REPRODUCE_H
#define LLD_COMMON_REPRODUCE_H

#include "lld/Core/LLVM.h"
#include "lld/Common/LLVM.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- lld/Config/Version.h - LLD Version Number ----------------*- C++ -*-===//
//===- lld/Common/Version.h - LLD Version Number ----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -14,7 +14,7 @@
#ifndef LLD_VERSION_H
#define LLD_VERSION_H

#include "lld/Config/Version.inc"
#include "lld/Common/Version.inc"
#include "llvm/ADT/StringRef.h"

namespace lld {
Expand Down
File renamed without changes.
Loading

0 comments on commit 3f85170

Please sign in to comment.