[lld] r231973 - Move the 'linker-script-test' binary to the tools directory.
Chandler Carruth
chandlerc at gmail.com
Wed Mar 11 15:05:50 PDT 2015
Author: chandlerc
Date: Wed Mar 11 17:05:49 2015
New Revision: 231973
URL: http://llvm.org/viewvc/llvm-project?rev=231973&view=rev
Log:
Move the 'linker-script-test' binary to the tools directory.
The canonical LLVM directory arrangement places binaries in the 'utils/'
tree when they are used as part of building the project. For example,
the tblgen binaries are built out of 'utils/' trees.
Tools which are not used by any other part of the build, including
testing utilities, are just in the 'tools' directory. For example, in
Clang we have 'c-index-test' which is exactly the same kind of thing as
'linker-script-test'.
Differential Revision: http://reviews.llvm.org/D8269
Added:
lld/trunk/tools/linker-script-test/
lld/trunk/tools/linker-script-test/CMakeLists.txt
- copied, changed from r231968, lld/trunk/utils/linker-script-test/CMakeLists.txt
lld/trunk/tools/linker-script-test/Makefile
- copied, changed from r231968, lld/trunk/utils/linker-script-test/Makefile
lld/trunk/tools/linker-script-test/linker-script-test.cpp
- copied, changed from r231968, lld/trunk/utils/linker-script-test/linker-script-test.cpp
Removed:
lld/trunk/utils/CMakeLists.txt
lld/trunk/utils/Makefile
lld/trunk/utils/linker-script-test/CMakeLists.txt
lld/trunk/utils/linker-script-test/Makefile
lld/trunk/utils/linker-script-test/linker-script-test.cpp
Modified:
lld/trunk/CMakeLists.txt
lld/trunk/Makefile
lld/trunk/tools/CMakeLists.txt
lld/trunk/tools/Makefile
Modified: lld/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/CMakeLists.txt?rev=231973&r1=231972&r2=231973&view=diff
==============================================================================
--- lld/trunk/CMakeLists.txt (original)
+++ lld/trunk/CMakeLists.txt Wed Mar 11 17:05:49 2015
@@ -88,7 +88,6 @@ endif()
add_subdirectory(lib)
add_subdirectory(tools)
-add_subdirectory(utils)
add_subdirectory(test)
Modified: lld/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/Makefile?rev=231973&r1=231972&r2=231973&view=diff
==============================================================================
--- lld/trunk/Makefile (original)
+++ lld/trunk/Makefile Wed Mar 11 17:05:49 2015
@@ -14,7 +14,7 @@ ifndef LLD_LEVEL
IS_TOP_LEVEL := 1
LLD_LEVEL := .
-DIRS := include lib tools utils unittests
+DIRS := include lib tools unittests
PARALLEL_DIRS :=
Modified: lld/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/CMakeLists.txt?rev=231973&r1=231972&r2=231973&view=diff
==============================================================================
--- lld/trunk/tools/CMakeLists.txt (original)
+++ lld/trunk/tools/CMakeLists.txt Wed Mar 11 17:05:49 2015
@@ -1 +1,2 @@
+add_subdirectory(linker-script-test)
add_subdirectory(lld)
Modified: lld/trunk/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/Makefile?rev=231973&r1=231972&r2=231973&view=diff
==============================================================================
--- lld/trunk/tools/Makefile (original)
+++ lld/trunk/tools/Makefile Wed Mar 11 17:05:49 2015
@@ -12,6 +12,6 @@ LEVEL := $(LLD_LEVEL)/../..
include $(LLD_LEVEL)/../../Makefile.config
-DIRS := lld
+PARALLEL_DIRS := linker-script-test lld
include $(LLD_LEVEL)/Makefile
Copied: lld/trunk/tools/linker-script-test/CMakeLists.txt (from r231968, lld/trunk/utils/linker-script-test/CMakeLists.txt)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/linker-script-test/CMakeLists.txt?p2=lld/trunk/tools/linker-script-test/CMakeLists.txt&p1=lld/trunk/utils/linker-script-test/CMakeLists.txt&r1=231968&r2=231973&rev=231973&view=diff
==============================================================================
(empty)
Copied: lld/trunk/tools/linker-script-test/Makefile (from r231968, lld/trunk/utils/linker-script-test/Makefile)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/linker-script-test/Makefile?p2=lld/trunk/tools/linker-script-test/Makefile&p1=lld/trunk/utils/linker-script-test/Makefile&r1=231968&r2=231973&rev=231973&view=diff
==============================================================================
(empty)
Copied: lld/trunk/tools/linker-script-test/linker-script-test.cpp (from r231968, lld/trunk/utils/linker-script-test/linker-script-test.cpp)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/linker-script-test/linker-script-test.cpp?p2=lld/trunk/tools/linker-script-test/linker-script-test.cpp&p1=lld/trunk/utils/linker-script-test/linker-script-test.cpp&r1=231968&r2=231973&rev=231973&view=diff
==============================================================================
(empty)
Removed: lld/trunk/utils/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/utils/CMakeLists.txt?rev=231972&view=auto
==============================================================================
--- lld/trunk/utils/CMakeLists.txt (original)
+++ lld/trunk/utils/CMakeLists.txt (removed)
@@ -1 +0,0 @@
-add_subdirectory(linker-script-test)
Removed: lld/trunk/utils/Makefile
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/utils/Makefile?rev=231972&view=auto
==============================================================================
--- lld/trunk/utils/Makefile (original)
+++ lld/trunk/utils/Makefile (removed)
@@ -1,17 +0,0 @@
-##===- tools/Makefile --------------------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LLD_LEVEL := ..
-LEVEL := $(LLD_LEVEL)/../..
-
-include $(LLD_LEVEL)/../../Makefile.config
-
-DIRS := linker-script-test
-
-include $(LLD_LEVEL)/Makefile
Removed: lld/trunk/utils/linker-script-test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/utils/linker-script-test/CMakeLists.txt?rev=231972&view=auto
==============================================================================
--- lld/trunk/utils/linker-script-test/CMakeLists.txt (original)
+++ lld/trunk/utils/linker-script-test/CMakeLists.txt (removed)
@@ -1,8 +0,0 @@
-add_llvm_executable(linker-script-test
- linker-script-test.cpp
- )
-
-target_link_libraries(linker-script-test
- LLVMSupport
- lldReaderWriter
- )
Removed: lld/trunk/utils/linker-script-test/Makefile
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/utils/linker-script-test/Makefile?rev=231972&view=auto
==============================================================================
--- lld/trunk/utils/linker-script-test/Makefile (original)
+++ lld/trunk/utils/linker-script-test/Makefile (removed)
@@ -1,24 +0,0 @@
-##===-------------- linker-script-test/Makefile ----------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===--------------------------------------------------------------------===##
-
-LLD_LEVEL := ../..
-
-TOOLNAME = linker-script-test
-
-# No plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-#include /Makefile.config
-LEVEL := $(LLD_LEVEL)/../..
-include $(LEVEL)/Makefile.config
-
-LINK_COMPONENTS := $(TARGETS_TO_BUILD)
-USEDLIBS = lldReaderWriter.a lldCore.a LLVMSupport.a
-
-include $(LLD_LEVEL)/Makefile
Removed: lld/trunk/utils/linker-script-test/linker-script-test.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/utils/linker-script-test/linker-script-test.cpp?rev=231972&view=auto
==============================================================================
--- lld/trunk/utils/linker-script-test/linker-script-test.cpp (original)
+++ lld/trunk/utils/linker-script-test/linker-script-test.cpp (removed)
@@ -1,57 +0,0 @@
-//===- utils/linker-script-test/linker-script-test.cpp --------------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// \brief Tool for testing linker script parsing.
-///
-//===----------------------------------------------------------------------===//
-
-#include "lld/ReaderWriter/LinkerScript.h"
-
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/Signals.h"
-
-using namespace llvm;
-using namespace lld;
-using namespace script;
-
-int main(int argc, const char **argv) {
- llvm::sys::PrintStackTraceOnErrorSignal();
- llvm::PrettyStackTraceProgram X(argc, argv);
-
- {
- ErrorOr<std::unique_ptr<MemoryBuffer>> mb =
- MemoryBuffer::getFileOrSTDIN(argv[1]);
- if (std::error_code ec = mb.getError()) {
- llvm::errs() << ec.message() << "\n";
- return 1;
- }
- Lexer l(std::move(mb.get()));
- Token tok;
- while (true) {
- l.lex(tok);
- tok.dump(llvm::outs());
- if (tok._kind == Token::eof || tok._kind == Token::unknown)
- break;
- }
- }
- {
- ErrorOr<std::unique_ptr<MemoryBuffer>> mb =
- MemoryBuffer::getFileOrSTDIN(argv[1]);
- if (std::error_code ec = mb.getError()) {
- llvm::errs() << ec.message() << "\n";
- return 1;
- }
- Parser p(std::move(mb.get()));
- if (!p.parse()) {
- LinkerScript *ls = p.get();
- ls->dump(llvm::outs());
- }
- }
-}
More information about the llvm-commits
mailing list