Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -88,7 +88,6 @@ add_subdirectory(lib) add_subdirectory(tools) -add_subdirectory(utils) add_subdirectory(test) Index: Makefile =================================================================== --- Makefile +++ Makefile @@ -14,7 +14,7 @@ IS_TOP_LEVEL := 1 LLD_LEVEL := . -DIRS := include lib tools utils unittests +DIRS := include lib tools unittests PARALLEL_DIRS := Index: tools/CMakeLists.txt =================================================================== --- tools/CMakeLists.txt +++ tools/CMakeLists.txt @@ -1 +1,2 @@ +add_subdirectory(linker-script-test) add_subdirectory(lld) Index: tools/Makefile =================================================================== --- tools/Makefile +++ tools/Makefile @@ -12,6 +12,6 @@ include $(LLD_LEVEL)/../../Makefile.config -DIRS := lld +PARALLEL_DIRS := linker-script-test lld include $(LLD_LEVEL)/Makefile Index: utils/CMakeLists.txt =================================================================== --- utils/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(linker-script-test) Index: utils/Makefile =================================================================== --- utils/Makefile +++ /dev/null @@ -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 Index: utils/linker-script-test/CMakeLists.txt =================================================================== --- /dev/null +++ utils/linker-script-test/CMakeLists.txt @@ -1,8 +0,0 @@ -add_llvm_executable(linker-script-test - linker-script-test.cpp - ) - -target_link_libraries(linker-script-test - LLVMSupport - lldReaderWriter - ) Index: utils/linker-script-test/Makefile =================================================================== --- /dev/null +++ utils/linker-script-test/Makefile @@ -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 Index: utils/linker-script-test/linker-script-test.cpp =================================================================== --- /dev/null +++ utils/linker-script-test/linker-script-test.cpp @@ -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> 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> 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()); - } - } -}