From 8496faea07de27b6d3435d02855db4bfebcc2781 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 17 Jun 2013 15:47:20 +0000 Subject: [PATCH] Move lib/Archive to tools/llvm-ar. llvm-ar is the only tool that needs to write archive files. Every other tool should be able to use the lib/Object interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184083 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Archive/CMakeLists.txt | 5 ----- lib/Archive/LLVMBuild.txt | 22 ------------------- lib/Archive/Makefile | 17 -------------- lib/CMakeLists.txt | 1 - lib/LLVMBuild.txt | 2 +- lib/Makefile | 2 +- {lib/Archive => tools/llvm-ar}/Archive.cpp | 2 +- .../llvm/Bitcode => tools/llvm-ar}/Archive.h | 4 ++-- .../llvm-ar}/ArchiveInternals.h | 6 ++--- .../llvm-ar}/ArchiveReader.cpp | 2 +- .../llvm-ar}/ArchiveWriter.cpp | 2 +- tools/llvm-ar/CMakeLists.txt | 5 ++++- tools/llvm-ar/LLVMBuild.txt | 1 - tools/llvm-ar/Makefile | 2 +- tools/llvm-ar/llvm-ar.cpp | 2 +- 15 files changed, 16 insertions(+), 59 deletions(-) delete mode 100644 lib/Archive/CMakeLists.txt delete mode 100644 lib/Archive/LLVMBuild.txt delete mode 100644 lib/Archive/Makefile rename {lib/Archive => tools/llvm-ar}/Archive.cpp (99%) rename {include/llvm/Bitcode => tools/llvm-ar}/Archive.h (99%) rename {lib/Archive => tools/llvm-ar}/ArchiveInternals.h (96%) rename {lib/Archive => tools/llvm-ar}/ArchiveReader.cpp (99%) rename {lib/Archive => tools/llvm-ar}/ArchiveWriter.cpp (99%) diff --git a/lib/Archive/CMakeLists.txt b/lib/Archive/CMakeLists.txt deleted file mode 100644 index 7ff478a41a5..00000000000 --- a/lib/Archive/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_llvm_library(LLVMArchive - Archive.cpp - ArchiveReader.cpp - ArchiveWriter.cpp - ) diff --git a/lib/Archive/LLVMBuild.txt b/lib/Archive/LLVMBuild.txt deleted file mode 100644 index d68550b45fe..00000000000 --- a/lib/Archive/LLVMBuild.txt +++ /dev/null @@ -1,22 +0,0 @@ -;===- ./lib/Archive/LLVMBuild.txt ------------------------------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[component_0] -type = Library -name = Archive -parent = Libraries -required_libraries = BitReader Core Support diff --git a/lib/Archive/Makefile b/lib/Archive/Makefile deleted file mode 100644 index da9780403a0..00000000000 --- a/lib/Archive/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- lib/Archive/Makefile --------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMArchive - -# We only want an archive so only those modules actually used by a tool are -# included. -BUILD_ARCHIVE := 1 - -include $(LEVEL)/Makefile.common diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 76ebe9aca9a..4d9aebcd0a2 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -14,4 +14,3 @@ add_subdirectory(DebugInfo) add_subdirectory(ExecutionEngine) add_subdirectory(Target) add_subdirectory(AsmParser) -add_subdirectory(Archive) diff --git a/lib/LLVMBuild.txt b/lib/LLVMBuild.txt index 05654438069..ff288bc78b7 100644 --- a/lib/LLVMBuild.txt +++ b/lib/LLVMBuild.txt @@ -16,7 +16,7 @@ ;===------------------------------------------------------------------------===; [common] -subdirectories = Analysis Archive AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker IR IRReader MC Object Option Support TableGen Target Transforms +subdirectories = Analysis AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker IR IRReader MC Object Option Support TableGen Target Transforms [component_0] type = Group diff --git a/lib/Makefile b/lib/Makefile index 57f016bc890..0a4435ef64d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -10,7 +10,7 @@ LEVEL = .. include $(LEVEL)/Makefile.config -PARALLEL_DIRS := IR AsmParser Bitcode Archive Analysis Transforms CodeGen \ +PARALLEL_DIRS := IR AsmParser Bitcode Analysis Transforms CodeGen \ Target ExecutionEngine Linker MC Object Option DebugInfo \ IRReader diff --git a/lib/Archive/Archive.cpp b/tools/llvm-ar/Archive.cpp similarity index 99% rename from lib/Archive/Archive.cpp rename to tools/llvm-ar/Archive.cpp index e6d4bae29da..3e9b9b2c253 100644 --- a/lib/Archive/Archive.cpp +++ b/tools/llvm-ar/Archive.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Bitcode/Archive.h" +#include "Archive.h" #include "ArchiveInternals.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/Module.h" diff --git a/include/llvm/Bitcode/Archive.h b/tools/llvm-ar/Archive.h similarity index 99% rename from include/llvm/Bitcode/Archive.h rename to tools/llvm-ar/Archive.h index e576463c85a..bd76298c422 100644 --- a/include/llvm/Bitcode/Archive.h +++ b/tools/llvm-ar/Archive.h @@ -14,8 +14,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_BITCODE_ARCHIVE_H -#define LLVM_BITCODE_ARCHIVE_H +#ifndef TOOLS_LLVM_AR_ARCHIVE_H +#define TOOLS_LLVM_AR_ARCHIVE_H #include "llvm/ADT/ilist.h" #include "llvm/ADT/ilist_node.h" diff --git a/lib/Archive/ArchiveInternals.h b/tools/llvm-ar/ArchiveInternals.h similarity index 96% rename from lib/Archive/ArchiveInternals.h rename to tools/llvm-ar/ArchiveInternals.h index bc5046de397..e906d7a0599 100644 --- a/lib/Archive/ArchiveInternals.h +++ b/tools/llvm-ar/ArchiveInternals.h @@ -11,11 +11,11 @@ // //===----------------------------------------------------------------------===// -#ifndef LIB_ARCHIVE_ARCHIVEINTERNALS_H -#define LIB_ARCHIVE_ARCHIVEINTERNALS_H +#ifndef TOOLS_LLVM_AR_ARCHIVEINTERNALS_H +#define TOOLS_LLVM_AR_ARCHIVEINTERNALS_H +#include "Archive.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Bitcode/Archive.h" #include "llvm/Support/TimeValue.h" #include diff --git a/lib/Archive/ArchiveReader.cpp b/tools/llvm-ar/ArchiveReader.cpp similarity index 99% rename from lib/Archive/ArchiveReader.cpp rename to tools/llvm-ar/ArchiveReader.cpp index fc3a01f1899..8ad01dca0be 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/tools/llvm-ar/ArchiveReader.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Bitcode/Archive.h" +#include "Archive.h" #include "ArchiveInternals.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallPtrSet.h" diff --git a/lib/Archive/ArchiveWriter.cpp b/tools/llvm-ar/ArchiveWriter.cpp similarity index 99% rename from lib/Archive/ArchiveWriter.cpp rename to tools/llvm-ar/ArchiveWriter.cpp index 97b34e616e1..24f5dbc0dc1 100644 --- a/lib/Archive/ArchiveWriter.cpp +++ b/tools/llvm-ar/ArchiveWriter.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Bitcode/Archive.h" +#include "Archive.h" #include "ArchiveInternals.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Bitcode/ReaderWriter.h" diff --git a/tools/llvm-ar/CMakeLists.txt b/tools/llvm-ar/CMakeLists.txt index 70eb7603fdc..68095df7142 100644 --- a/tools/llvm-ar/CMakeLists.txt +++ b/tools/llvm-ar/CMakeLists.txt @@ -1,7 +1,10 @@ -set(LLVM_LINK_COMPONENTS archive) +set(LLVM_LINK_COMPONENTS support bitreader) add_llvm_tool(llvm-ar llvm-ar.cpp + ArchiveWriter.cpp + ArchiveReader.cpp + Archive.cpp ) # TODO: Support check-local. diff --git a/tools/llvm-ar/LLVMBuild.txt b/tools/llvm-ar/LLVMBuild.txt index 1f61a320148..236b4659f7b 100644 --- a/tools/llvm-ar/LLVMBuild.txt +++ b/tools/llvm-ar/LLVMBuild.txt @@ -19,4 +19,3 @@ type = Tool name = llvm-ar parent = Tools -required_libraries = Archive diff --git a/tools/llvm-ar/Makefile b/tools/llvm-ar/Makefile index fafb14bc12a..9e782cfca59 100644 --- a/tools/llvm-ar/Makefile +++ b/tools/llvm-ar/Makefile @@ -9,7 +9,7 @@ LEVEL := ../.. TOOLNAME := llvm-ar -LINK_COMPONENTS := archive +LINK_COMPONENTS := bitreader support # This tool has no plugins, optimize startup time. TOOL_NO_EXPORTS := 1 diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 243a845e3c6..2a4a3deecdd 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// +#include "Archive.h" #include "llvm/IR/LLVMContext.h" -#include "llvm/Bitcode/Archive.h" #include "llvm/IR/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileSystem.h"